kc3-lang/libevent/buffer.c

Branch :


Log

Author Commit Date CI Message
0ba0af9c 2011-09-29 09:30:04 Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL. The sendfile() implementation for evbuffer_add_file is potentially more efficient, but it has a problem: you can only use it to send bytes over a socket using sendfile(). If you are writing bytes via SSL_send() or via a filter, or if you need to be able to inspect your buffer, it doesn't work. As an easy fix, this patch disables the sendfile-based implementation of evbuffer_add_file on an evbuffer unless the user sets a new EVBUFFER_FLAG_DRAINS_TO_FD flag on that evbuffer, indicating that the evbuffer will not be inspected, but only written out via evbuffer_write(), evbuffer_write_atmost(), or drained with stuff like evbuffer_drain() or evbuffer_add_buffer(). This flag is off by default, except for evbuffers used for output on bufferevent_socket. In the future, it could be interesting to make a best-effort file segment implementation that tries to send via sendfile, but mmaps on demand. That's too much complexity for a stable release series, though.
1ef1f684 2011-09-28 09:22:17 Make evbuffer callbacks get the right n_added value after evbuffer_add Patch from Alex.
6acfbdd8 2011-08-18 12:35:27 Make overlapped reads result in evbuffer callbacks getting invoked
643922e9 2011-08-15 13:39:10 Solaris sendfile: correctly detect amount of data sent Original message: Solaris sendfile seems to fail when sending moderately large (<1GB) files. Not a 32/64 problem, but a buffer problem. Anyone else ever try this? It is definitely broken in http-server.c. It seems to be broken in the following way: When sendfile sends partial data (EAGAIN, would block), "res" is always -1, rather than the amount sent. Here's a patch that reads from the "offset" pointer instead to discover what was sent. This seems to work:
f87f5689 2011-07-04 11:47:24 Speed up invoke_callbacks on evbuffers when there are no callbacks This fixes a performance regression against 1.4
4461f1a0 2011-06-06 15:11:28 Fix incorrect results from evbuffer_search_eol(EOL_LF) Our evbuffer_strchr() function [which was only used for search_eol(EOL_LF) could give incorrect results if it found its answer in the first chunk but didn't start searching from the front of the chunk. Also, this patch adds unit tests for evbuffer_search_eol, particularly in those cases that evbuffer_readln() tests didn't exercise.
b63ab177 2010-12-06 14:17:44 EVUTIL_ASSERT: Use sizeof() to avoid "unused variable" warnings.
bb0d2b4e 2010-12-09 11:47:54 Consistentize tabs
7bcace2d 2010-11-22 21:02:34 Fix some irix compilation warnings spotted by Kevin Bowling
a3245afe 2010-11-01 14:23:33 Fix win32 build in response to fixes from win64 build.