include/event2/buffer.h


Log

Author Commit Date CI Message
Nick Mathewson ec347b92 2010-07-07T16:45:03 Move event-config.h to include/event2 This change means that all required include files are in event2, and all files not in event2/* are optional.
Nick Mathewson eb86c8c5 2010-04-12T22:24:54 Add evbuffer_copyout to copy data from an evbuffer without draining The evbuffer_remove() function copies data from the front of an evbuffer into an array of char, and removes the data from the buffer. This function behaves the same, but does not remove the data. This behavior can be handy for lots of protocols, where you want the evbuffer to accumulate data until a complete record has arrived. Lots of people have asked for a function more or less like this, and though it isn't too hard to code one from evbuffer_peek(), it is apparently annoying to do it in every app you write. The evbuffer_peek() function is significantly faster, but it requires that the user be able to handle data in separate extents. This patch also reimplements evbufer_remove() as evbuffer_copyout() followed by evbuffer_drain(). I am reasonably confident that this won't be a performance hit: the memcpy() overhead should dominate the cost of walking the list an extra time.
Nick Mathewson 17efc1cd 2010-03-04T01:25:51 Update all our copyright notices to say "2010"
Nick Mathewson e5bbd40a 2010-02-18T17:41:15 Clean up formatting: use tabs, not 8-spaces, to indent.
Nick Mathewson 3fe60fdf 2010-02-12T23:40:13 Use off_t for the length parameter of evbuffer_add_file
Nick Mathewson 390e0561 2009-12-22T15:52:02 Fix up behavior of never-defered callbacks a little
Nick Mathewson 438f9ed2 2009-11-23T15:53:24 Add the abilitity to mark some buffer callbacks as never-deferred.
Nick Mathewson 8a99083f 2009-08-07T17:16:52 Add an evbuffer_search_range() to search a bounded range of a buffer This can be handy when you have one search to find the end of a header section, and then you want to find a substring within the header section without looking at the body. svn:r1410
Nick Mathewson d4134772 2009-07-31T17:35:42 Refactor evbuffer_readln() into a search-for-eol function and an extract-line function. svn:r1404
Nick Mathewson 0b4ab122 2009-05-28T15:47:15 Spell-check the the headers svn:r1320
Nick Mathewson 3f0e4928 2009-05-27T23:48:59 small doc fix. svn:r1319
Nick Mathewson 0b22ca19 2009-05-22T19:11:48 Use ev_ssize_t in place of ssize_t *everywhere*. svn:r1309
Nick Mathewson 8997f234 2009-05-21T20:59:00 Use the native "struct iovec" as our "struct evbuffer_iovec" when available, so we do not need to copy more pointers than necessary. svn:r1299
Nick Mathewson 23243b8a 2009-05-19T21:39:35 Replace reserve/commit with new iovec-based interface. Add a new evbuffer_peek. svn:r1296
Nick Mathewson dc4c7b95 2009-05-15T22:44:18 Change the interface of evbuffer_add_reference: give the cleanup function more info. svn:r1294
Nick Mathewson bba69e03 2009-05-15T20:23:59 New semantics for evbuffer_cb_set_flags(). Previously, set_flags() would replace all previous user-visible flags. Now it just sets the flags, and there is a clear_flags() function to clear other flags. svn:r1293
Nick Mathewson 27fef1ef 2009-05-14T18:06:41 Note problems with some newer evbuffer interfaces. svn:r1286
Nick Mathewson b2e8fd0e 2009-04-30T23:56:53 Apparently MSVC lacks a ssize_t. Define an ev_ssize_t for headers, and make ssize_t work elsewhere. svn:r1261
Nick Mathewson 49354138 2009-04-17T06:57:13 Oh hey. There is no support for suspend/unsuspend. svn:r1187
Nick Mathewson a8f6d961 2009-04-17T06:56:09 Actually stop using EVBUFFER_LENGTH/DATA, and move them to buffer_compat.h svn:r1183
Nick Mathewson 796ba15f 2009-04-17T06:55:25 Stop claiming that APIs we have are missing. svn:r1182
Nick Mathewson 838d0a81 2009-04-17T06:55:08 Document many internal functions and pieces of code. svn:r1181
Nick Mathewson 93d4f884 2009-04-14T20:11:10 Make buffer iocp stuff compile happily svn:r1174
Nick Mathewson b29b875d 2009-04-10T20:43:08 Facility to make evbuffers get their callbacks deferred. svn:r1154
Nick Mathewson 747331d1 2009-04-08T03:04:39 Add freeze support to evbuffers. From the documentation: Prevent calls that modify an evbuffer from succeeding. A buffer may frozen at the front, at the back, or at both the front and the back. If the front of a buffer is frozen, operations that drain data from the front of the buffer, or that prepend data to the buffer, will fail until it is unfrozen. If the back a buffer is frozen, operations that append data from the buffer will fail until it is unfrozen. We'll use this to ensure correctness on an evbuffer when we're waiting for an overlapped IO call to finish. svn:r1143
Nick Mathewson 60e0d59b 2009-04-05T02:44:17 Add locking to evbuffers. svn:r1134
Nick Mathewson f1b1bad4 2009-04-03T14:27:03 Make the new evbuffer callbacks use a new struct-based interface. The old interface would fail pretty hard when we had to batch up multiple adds and drains in a single call. svn:r1131
Nick Mathewson f90500a5 2009-04-03T01:21:36 Add a new improved search function. The old evbuffer_find didn't allow iterative searching, and forced us to repack the buffer completely every time we searched in it. The new evbuffer_search addresses both of these. As a side-effect, the evbuffer_find implementation is now a little more efficient. svn:r1130
Niels Provos 994e8578 2009-03-30T17:36:22 correct evbuffer_drain documentation from John Khvatov svn:r1127
Nick Mathewson ea4b8724 2009-02-02T19:22:13 checkpoint work on big bufferevent refactoring svn:r1095
Nick Mathewson 8d3a10f8 2009-02-01T01:43:58 Support temporarily suspending an evbuffer callback. This is different from disabling the callback, since we want to process changes, but not just yet. svn:r1091
Nick Mathewson 2e50658d 2009-02-01T01:07:33 Fix a typo in buffer.h svn:r1089
Niels Provos 66b2a7ff 2009-01-29T03:20:40 test evbuffer_add_reference svn:r1068
Nick Mathewson b85b710c 2009-01-27T22:34:36 Update copyright statements to reflect the facts that: a) this is 2009 b) niels and nick have been comaintainers for a while c) saying "all rights reserved" when you then go on to explicitly disclaim some rights is sheer cargo-cultism. svn:r1065
Niels Provos fdf69493 2009-01-27T06:05:38 sendfile/mmap and memory reference implementation for evbuffers svn:r1057
Niels Provos b93e5054 2009-01-27T05:33:39 second argument to evbuffer_pullup should be ssize_t svn:r1056
Nick Mathewson 81dd04a7 2009-01-23T18:04:34 Add a "flags" field to evbuffer callbacks. For now, there is just one: enabled. This lets us avoid lots of mallocs/frees/tailq-manipulations just to turn a callback on and off. The revised bufferevent code wants this. svn:r1047
Nick Mathewson de7f7a84 2009-01-23T18:03:45 Remove in_callbacks check: allow full recursion in evbuffer callbacks. If you get yourself in an infinite loop, that's not our fault. Note this in the docs. Also reindent some docs now that my tabs match Niels's. svn:r1046
Nick Mathewson ec2f4cbc 2009-01-23T01:35:57 Move obsolete evbuffer function into include/event2/buffer_compat.h svn:r1043
Nick Mathewson c735f2b4 2009-01-23T01:11:13 Code to allow multiple callbacks per evbuffer. svn:r1042
Nick Mathewson 84031819 2009-01-14T22:17:31 Make some evbuffer functions const svn:r1010
Nick Mathewson 99db0e7f 2009-01-12T20:42:19 Add a new evbuffer_write_atmost() functino to write no more than a given number of bytes to an fd. svn:r993
Nick Mathewson f446f149 2009-01-12T20:42:06 Small cleanups to buffer.h documentation. svn:r992
Nick Mathewson 6bf1ca78 2008-05-12T00:40:04 r19675@catbus: nickm | 2008-05-11 20:39:39 -0400 Stop pretending that u_char and u_short are standard types that win32 is dumb not to have. In fact, u_char can really just be spelled out, and u_short was usually just a bad way of saying ev_uint16_t. svn:r808
Nick Mathewson 8acb80b4 2008-05-08T22:51:39 r15551@tombo: nickm | 2008-05-08 14:49:20 -0400 Use _get_ convention for new accessor functions. (These are all new ones as of 2.0, I believe). svn:r799
Niels Provos f04497e4 2008-05-03T03:05:28 introduce evbuffer_reserve_space() and evbuffer_commit_space() to make processing in filters more efficient svn:r757
Niels Provos becc89b7 2008-05-03T02:37:18 introduce evbuffer_contiguous_space() and use it in the zlib filter test svn:r756
Nick Mathewson beb39f57 2008-04-17T19:16:30 r15218@tombo: nickm | 2008-04-17 15:10:13 -0400 Add a missing #include <stdarg.h> svn:r715
Nick Mathewson 0c843507 2008-04-10T19:25:11 r19301@catbus: nickm | 2008-04-10 14:54:46 -0400 Forward-port: Correct the documentation on evbuffer_add_[v]printf: Fix for bug 1914464. svn:r705
Nick Mathewson 0322ce0a 2008-02-28T18:36:03 r18486@catbus: nickm | 2008-02-28 13:35:53 -0500 Make offsetof into evutil_offsetof. Be a little more willing to call evbuffer_chain_align() from evbuffer_expand(). Clarify some docs, and add some XXX comments to note questionable areas. svn:r677
Niels Provos 5c70ea4c 2008-02-28T02:47:43 improved code for evbuffer; avoids memcpy svn:r674