On Wed, May 07, 2008 at 11:47:09PM -0700, Niels Provos wrote:
> Hi Manual,
> 
> this is a good suggestion.   Nick and I are currently working on how
> buffers and http work in libevent 2.0.  You might want to check out
> trunk to see some of the progress there.   In any case, it seems that
> your sendfile changes would be a good fit there.  BTW, sendfile is
> available on a large number of platforms now.

In fact, this fits pretty well into the newer evbuffer implementation.
Whereas the old implementation used a big chunk of memory for the
entire buffer, the new code uses a linked list of small chunks. (This
removes the need for big memmov operations, and generally makes
writing big files more efficient.)

All we'd need to do to support sendfile is add another chunk type
whose contents were a file rather than a chunk of ram.  We'd probably
want at least two ways to "add a file at this point in the stream":
one taking a filename and one taking an fd.  Of course, we'd need to
make sure to fall back on mmap() for systems lacking sendfile(), and
maybe on a series of read() operations on systems lacking mmap().

yrs,
-- 
Nick
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to