summaryrefslogtreecommitdiff
path: root/buffer.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * Update copyright notices to 2012Nick Mathewson2012-02-101-1/+1
| |
* | Replace more C99/C++ comments with oldschool /* */ commentsNick Mathewson2012-02-021-14/+14
| |
* | Merge remote-tracking branch 'github/linked_list'Nick Mathewson2012-01-201-13/+13
|\ \ | | | | | | | | | | | | Conflicts: include/event2/event_struct.h
| * | Use LIST rather than TAILQ for evbuffer callbacksNick Mathewson2010-04-091-12/+12
| | | | | | | | | | | | | | | | | | There's no reason to traverse these out-of-order, and we never defined the order that you'd get your callbacks on an evbuffer if you happened to add more than one.
* | | Merge remote-tracking branch 'origin/patches-2.0'Nick Mathewson2011-12-081-1/+8
|\ \ \ | | |/ | |/|
| * | Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0)Zack Weinberg2011-12-081-1/+8
| | | | | | | | | | | | | | | (Patch altered by nickm to not affect the behavior of evbuffer_peek(buf,-1,NULL,vec,n_vec).)
* | | whitespace fixesNick Mathewson2011-12-081-3/+3
| | |
* | | Merge remote-tracking branch 'fancycode/buffer_references'Nick Mathewson2011-12-081-2/+118
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: buffer.c
| * | | Changed use of refcounts to make sure referenced chains are freed in all cases.Joachim Bauch2011-12-071-14/+11
| | | |
| * | | fixed typoJoachim Bauch2011-10-171-1/+1
| | | |
| * | | added comments to describe refcounting of multicase chainsJoachim Bauch2011-10-171-2/+11
| | | |
| * | | prevent nested multicast references, reworked lockingJoachim Bauch2011-08-091-30/+12
| | | |
| * | | support adding buffers to other buffers non-destructivelyJoachim Bauch2011-08-091-1/+130
| | | |
* | | | Add evbuffer_copyout_from to copy data from the middle of a bufferNick Mathewson2011-12-071-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | You could previously do this with evbuffer_peek() and some memcpys, but it was a bit more work than most folks wanted to get into. Closes sourceforge ticket 3108072
* | | | fix windows compilation issues with new file segment codeNick Mathewson2011-12-021-1/+3
| | | | | | | | | | | | | | | | Found by Linus Nordberg
* | | | New EVBUFFER_EOL_NUL to read NUL-terminated strings from an evbufferAndrea Montefusco2011-11-141-0/+5
| | | |
* | | | Tweaks, fixups, and comments on evbuffer_add_iovecNick Mathewson2011-11-111-1/+6
| | | |
* | | | Added evbuffer_add_iovec and unit tests.Mark Ellzey2011-11-111-0/+31
| | | |
* | | | Merge remote-tracking branch 'github/20_evbuffer_remove_bug'Nick Mathewson2011-11-021-15/+5
|\ \ \ \
| * | | | Use the free-trailing-chains function in evbuffer_insert_chain tooNick Mathewson2011-11-021-15/+5
| | |/ / | |/| |
* | | | Merge remote-tracking branch 'origin/patches-2.0'Nick Mathewson2011-11-021-1/+32
|\ \ \ \ | |/ / /
| * | | Fix an evbuffer crash in evbuffer_remove_buffer()Nick Mathewson2011-11-021-1/+32
| | | | | | | | | | | | | | | | Found by Greg Hazel.
* | | | Merge remote-tracking branch 'origin/patches-2.0'Nick Mathewson2011-10-261-1/+1
|\ \ \ \ | |/ / /
| * | | Update copyright dates to 2011.Nick Mathewson2011-10-241-1/+1
| | | |
* | | | Make evbuffer_file_segment_types adaptableNick Mathewson2011-10-061-26/+57
| | | | | | | | | | | | | | | | | | | | | | | | Instead of having a file segment born as one type and stay that way forever, let them start out unmapped, but map themselves as needed if they need to get written out on a non-drains_to_fd evbuffer.
* | | | Merge remote-tracking branch 'origin/patches-2.0'Nick Mathewson2011-10-061-1/+18
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | Conflicts: buffer.c test/regress_buffer.c
| * | | Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file ↵Nick Mathewson2011-09-291-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge remote-tracking branch 'origin/patches-2.0'Nick Mathewson2011-09-281-0/+1
|\ \ \ \ | |/ / /
| * | | Make evbuffer callbacks get the right n_added value after evbuffer_addNick Mathewson2011-09-281-0/+1
| | | | | | | | | | | | | | | | Patch from Alex.
* | | | Merge remote-tracking branch 'origin/patches-2.0'Nick Mathewson2011-08-181-1/+1
|\ \ \ \ | |/ / /
| * | | Make overlapped reads result in evbuffer callbacks getting invokedNick Mathewson2011-08-181-1/+1
| | | |
* | | | Merge remote-tracking branch 'origin/patches-2.0'Nick Mathewson2011-08-171-5/+11
|\ \ \ \ | |/ / / | | / / | |/ / |/| | Conflict in buffer.c: the new file-segment logic conflicted with the solaris sendfile fix.
| * | Solaris sendfile: correctly detect amount of data sentMichael Herf2011-08-151-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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:
* | | Merge remote-tracking branch 'github/21_end_of_buffer'Nick Mathewson2011-07-051-12/+37
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: include/event2/buffer.h
| * | | Set the special "not found" evbuffer_ptr consistantly.Nir Soffer2011-06-201-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The _internal.pos_in_chain field was uninitialized or set to different values in different places returning the special "not found" pointer. Signed-off-by: Nir Soffer <nirsof@gmail.com>
| * | | Tweaks to return types with end-of-buf ptrsNick Mathewson2011-06-131-5/+7
| | | |
| * | | Allow evbuffer_ptr to point to position 0 in an empty evbufferNir Soffer2011-06-131-3/+19
| | | |
| * | | Allow evbuffer_ptr_set to yield a point just after the end of the buffer.Nick Mathewson2011-06-131-1/+6
| | | |
* | | | Merge remote-tracking branch 'origin/patches-2.0'Nick Mathewson2011-07-041-0/+5
|\ \ \ \ | |/ / / |/| / / | |/ /
| * | Speed up invoke_callbacks on evbuffers when there are no callbacksMark Ellzey2011-07-041-0/+5
| | | | | | | | | | | | This fixes a performance regression against 1.4
* | | Remove a needless branch in evbuffer_drain()Nick Mathewson2011-06-081-4/+2
| | | | | | | | | | | | Found by Gilad Benjamini; see June 2011 thread "Dead or wrong code".
* | | Fix a bug in the improved EOL_CRLF codeNick Mathewson2011-06-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | When searching for a CRLF, it would find an LF, then look for a preceding CR if not at the start of the buffer. That's fine when we're starting from the beginning of the buffer, but if we're starting at (say) byte 100, and we have that byte == LF, we shouldn't check for a CR at byte 99.
* | | Merge remote-tracking branch 'origin/patches-2.0'Nick Mathewson2011-06-061-1/+1
|\ \ \ | |/ /
| * | Fix incorrect results from evbuffer_search_eol(EOL_LF)Nick Mathewson2011-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Fix windows file segment mappingsNick Mathewson2011-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Instead of mapping enough bytes for each segment, we were failing to take into account the slop created by rounding the segment position down to the nearest page. Should fix bug 3142394 found by Sebastian Hahn.
* | | Try to squeeze a little more speed out of EVBUFFER_EOL_CRLFNick Mathewson2011-06-011-3/+32
| | |
* | | Roughly 20% speed increase when line-draining a buffer using EVBUFFER_EOL_CRLFMina Naguib2011-05-311-15/+11
| | |
* | | Use "_WIN32", not WIN32: it's standard and we don't need to fake itNick Mathewson2011-05-251-12/+12
| | | | | | | | | | | | | | | | | | This patch was automatically generated with perl. Based on a patch by Peter Rosin.
* | | Merge remote branch 'kev009/21_ac_use_system_extensions'Nick Mathewson2011-01-071-3/+4
|\ \ \
| * | | Remove use and reference to event-private.hKevin Bowling2011-01-071-1/+1
| | | |