[ANN] x0 HTTP server and framework (initial release)

Christian Parpart trapni at gentoo.org
Sat Apr 3 12:51:02 CEST 2010


On Thursday 01 April 2010 10:53:39 Graham Leggett wrote:
> Not sure how far you are, but the APR-util library underneath httpd  
> gives you some very powerful and helpful APIs, most specifically the  
> bucket brigades API, to give you a "virtual" view (buckets) of  
> "physical" memory areas (area in RAM, static area in RAM, area in file  
> on disk, data in socket, etc), which in turn makes it easy to support  
> SENDFILE, as well as the pools API, which allows you the freedom to  
> fail your request or connection at any time and be guaranteed you've  
> freed all your RAM with no leaks. Works side by side with libev  
> without a problem.

I am having a source/sink API for that, that supports different types
of sources/sinks (buffer, file, filter, composite, ...) which I am 
pretty proud of.
However, I got told that my current sendfile() use is not ideal, as it is 
indeed nonblocking for the target fd but the source fd (on-disk file)
it still may block. Which is something I have to work around
once the x0 core matures.

I like the idea of memory pools, too, however, I am using a slightly different 
approach for at least request buffer(s) and their extracted values, where I 
keep the whole request in a single buffer and let field values just reference 
the sub sections (offset + count) to reduce the number of malloc/memcpy/free 
calls.

Happy eastern!
Christian Parpart.



More information about the libev mailing list