Nick Mathewson
8a99083f01
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
2009-08-07 17:16:52 +00:00
Nick Mathewson
d41347722a
Refactor evbuffer_readln() into a search-for-eol function and an extract-line function.
...
svn:r1404
2009-07-31 17:35:42 +00:00
Nick Mathewson
0b4ab12251
Spell-check the the headers
...
svn:r1320
2009-05-28 15:47:15 +00:00
Nick Mathewson
3f0e49283b
small doc fix.
...
svn:r1319
2009-05-27 23:48:59 +00:00
Nick Mathewson
0b22ca1929
Use ev_ssize_t in place of ssize_t *everywhere*.
...
svn:r1309
2009-05-22 19:11:48 +00:00
Nick Mathewson
8997f234f2
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
2009-05-21 20:59:00 +00:00
Nick Mathewson
23243b8a98
Replace reserve/commit with new iovec-based interface. Add a new evbuffer_peek.
...
svn:r1296
2009-05-19 21:39:35 +00:00
Nick Mathewson
dc4c7b9570
Change the interface of evbuffer_add_reference: give the cleanup function more info.
...
svn:r1294
2009-05-15 22:44:18 +00:00
Nick Mathewson
bba69e03f8
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
2009-05-15 20:23:59 +00:00
Nick Mathewson
27fef1ef26
Note problems with some newer evbuffer interfaces.
...
svn:r1286
2009-05-14 18:06:41 +00:00
Nick Mathewson
b2e8fd0e41
Apparently MSVC lacks a ssize_t. Define an ev_ssize_t for headers, and make ssize_t work elsewhere.
...
svn:r1261
2009-04-30 23:56:53 +00:00
Nick Mathewson
4935413842
Oh hey. There is no support for suspend/unsuspend.
...
svn:r1187
2009-04-17 06:57:13 +00:00
Nick Mathewson
a8f6d961eb
Actually stop using EVBUFFER_LENGTH/DATA, and move them to buffer_compat.h
...
svn:r1183
2009-04-17 06:56:09 +00:00
Nick Mathewson
796ba15fc6
Stop claiming that APIs we have are missing.
...
svn:r1182
2009-04-17 06:55:25 +00:00
Nick Mathewson
838d0a81c3
Document many internal functions and pieces of code.
...
svn:r1181
2009-04-17 06:55:08 +00:00
Nick Mathewson
93d4f884aa
Make buffer iocp stuff compile happily
...
svn:r1174
2009-04-14 20:11:10 +00:00
Nick Mathewson
b29b875d84
Facility to make evbuffers get their callbacks deferred.
...
svn:r1154
2009-04-10 20:43:08 +00:00
Nick Mathewson
747331d164
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
2009-04-08 03:04:39 +00:00
Nick Mathewson
60e0d59b33
Add locking to evbuffers.
...
svn:r1134
2009-04-05 02:44:17 +00:00
Nick Mathewson
f1b1bad415
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
2009-04-03 14:27:03 +00:00
Nick Mathewson
f90500a5df
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
2009-04-03 01:21:36 +00:00
Niels Provos
994e85781c
correct evbuffer_drain documentation from John Khvatov
...
svn:r1127
2009-03-30 17:36:22 +00:00
Nick Mathewson
ea4b8724c0
checkpoint work on big bufferevent refactoring
...
svn:r1095
2009-02-02 19:22:13 +00:00
Nick Mathewson
8d3a10f8f1
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
2009-02-01 01:43:58 +00:00
Nick Mathewson
2e50658d8d
Fix a typo in buffer.h
...
svn:r1089
2009-02-01 01:07:33 +00:00
Niels Provos
66b2a7ffb7
test evbuffer_add_reference
...
svn:r1068
2009-01-29 03:20:40 +00:00
Nick Mathewson
b85b710cf5
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
2009-01-27 22:34:36 +00:00
Niels Provos
fdf694933c
sendfile/mmap and memory reference implementation for evbuffers
...
svn:r1057
2009-01-27 06:05:38 +00:00
Niels Provos
b93e505452
second argument to evbuffer_pullup should be ssize_t
...
svn:r1056
2009-01-27 05:33:39 +00:00
Nick Mathewson
81dd04a726
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
2009-01-23 18:04:34 +00:00
Nick Mathewson
de7f7a84a3
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
2009-01-23 18:03:45 +00:00
Nick Mathewson
ec2f4cbc09
Move obsolete evbuffer function into include/event2/buffer_compat.h
...
svn:r1043
2009-01-23 01:35:57 +00:00
Nick Mathewson
c735f2b45a
Code to allow multiple callbacks per evbuffer.
...
svn:r1042
2009-01-23 01:11:13 +00:00
Nick Mathewson
840318196b
Make some evbuffer functions const
...
svn:r1010
2009-01-14 22:17:31 +00:00
Nick Mathewson
99db0e7f72
Add a new evbuffer_write_atmost() functino to write no more than a given number of bytes to an fd.
...
svn:r993
2009-01-12 20:42:19 +00:00
Nick Mathewson
f446f1493a
Small cleanups to buffer.h documentation.
...
svn:r992
2009-01-12 20:42:06 +00:00
Nick Mathewson
6bf1ca780c
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
2008-05-12 00:40:04 +00:00
Nick Mathewson
8acb80b4f9
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
2008-05-08 22:51:39 +00:00
Niels Provos
f04497e493
introduce evbuffer_reserve_space() and evbuffer_commit_space() to make processing in filters more efficient
...
svn:r757
2008-05-03 03:05:28 +00:00
Niels Provos
becc89b778
introduce evbuffer_contiguous_space() and use it in the zlib filter test
...
svn:r756
2008-05-03 02:37:18 +00:00
Nick Mathewson
beb39f5770
r15218@tombo: nickm | 2008-04-17 15:10:13 -0400
...
Add a missing #include <stdarg.h>
svn:r715
2008-04-17 19:16:30 +00:00
Nick Mathewson
0c843507ab
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
2008-04-10 19:25:11 +00:00
Nick Mathewson
0322ce0a3b
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
2008-02-28 18:36:03 +00:00
Niels Provos
5c70ea4c9d
improved code for evbuffer; avoids memcpy
...
svn:r674
2008-02-28 02:47:43 +00:00