Nick Mathewson
659d54d530
Add new code to make and accept connections.
...
This is stuff that it's easy to get wrong (as I noticed when writing
bench_http), and that takes up a fair amount of space (see http.c).
Also, it's something that we'll eventually want to abstract to use
IOCP, where available.
svn:r1272
2009-05-05 02:59:26 +00:00
Nick Mathewson
0fd70978c8
Add an event_get_base() function to remove one more reason to include event_struct.h
...
svn:r1271
2009-05-05 01:09:03 +00:00
Nick Mathewson
d5ca076379
Move event_set() and friends to event2/event_compat.h.
...
These functions are deprecated in favor of event_assign().
svn:r1267
2009-05-02 16:23:29 +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
1959414120
Clarify semantics on event_pending()
...
svn:r1249
2009-04-29 20:48:21 +00:00
Niels Provos
a146af1db8
move more code directly into evrpc.c; provide backwards compatible vararg macros
...
svn:r1244
2009-04-25 00:15:55 +00:00
Niels Provos
b228ff91b8
remove vararg macros for accessing evrpc structs
...
svn:r1243
2009-04-25 00:15:31 +00:00
Niels Provos
bbf79707f9
refactor evrpc.h header filer
...
svn:r1241
2009-04-25 00:14:58 +00:00
Nick Mathewson
11ff74cf64
Add a flag to disable checking the EVENT_* environment variables.
...
svn:r1220
2009-04-22 19:41:23 +00:00
Nick Mathewson
ea8cc76cf8
Fix the documentation of event_pending.
...
svn:r1215
2009-04-21 18:47:23 +00:00
Nick Mathewson
eda27f9557
Update copyright notices, add some missing license statements
...
svn:r1208
2009-04-19 20:54:12 +00:00
Niels Provos
f00f0c2533
make doxygen happier
...
svn:r1199
2009-04-18 04:34:45 +00:00
Nick Mathewson
a98a512bc1
Add a generic way for any bufferevent to make its callback deferred
...
svn:r1197
2009-04-17 23:12:34 +00:00
Nick Mathewson
d047b323bd
Increment version to 2.0.1-alpha, and add a numeric version facility
...
svn:r1193
2009-04-17 17:22:32 +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
7fa8451d7e
Add a configure flag to hardcode all of our mm functions.
...
svn:r1186
2009-04-17 06:56:57 +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
Niels Provos
30648529e8
have evhttp_set_cb return an int; -1 on failure, 0 on success; this is better than returning a pointer
...
svn:r1179
2009-04-17 01:03:07 +00:00
Nick Mathewson
93d4f884aa
Make buffer iocp stuff compile happily
...
svn:r1174
2009-04-14 20:11:10 +00:00
Nick Mathewson
915193e7df
Locking support for bufferevents.
...
svn:r1170
2009-04-13 03:17:19 +00:00
Nick Mathewson
1becc4c4e6
Refactor new elements of bufferevent into bufferevent_private structure
...
This way we don't expose more of a bufferevent than we need to. One
motivation is to make it easier to automatically get deferred callbacks
with a bufferevent without exposing the deferred_cb structure.
svn:r1169
2009-04-13 03:08:11 +00:00
Nick Mathewson
6567ecd4c5
Remove if0 code in bufferevent_struct.h
...
svn:r1168
2009-04-13 03:07:37 +00:00
Niels Provos
d2794e65e0
document evhttp_parse_query better
...
svn:r1157
2009-04-11 15:26:29 +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
decdacfaf8
Better explanation for bufferevent_pair
...
svn:r1153
2009-04-10 20:42:53 +00:00
Nick Mathewson
23085c9247
Add a linked-pair abstraction to bufferevents.
...
The new bufferevent_pair abstraction works like a set of buferevent_sockets
connected by a socketpair, except that it doesn't require a socketpair,
and therefore doesn't need to get the kernel involved.
It's also a good way to make sure that deferred callbacks work. It's a good
use case for deferred callbacks: before I implemented them, the recursive
relationship between the evbuffer callback and the read callback would
make the unit tests overflow the stack.
svn:r1152
2009-04-10 15:01:31 +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
d2e9caa6fc
Fix evdns_cancel to alert callback and free associated RAM.
...
Also, we add a test to make sure evdns_cancel is working properly.
svn:r1139
2009-04-06 20:38:19 +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
ec35eb5520
Make threading functions global, like the mm_ functions. Use the libevent_pthread.la library in regress_pthread.
...
svn:r1121
2009-02-12 22:19:54 +00:00
Nick Mathewson
77c80b8dcf
New bind-to option to allow DNS clients to bind to arbitrary ports for their outgoing addresses.
...
svn:r1119
2009-02-11 17:24:11 +00:00
Nick Mathewson
acaf65c359
Make evutil_parse_sockaddr_port give a useful socket-length output.
...
svn:r1118
2009-02-11 17:23:32 +00:00
Nick Mathewson
c7b2f8fdc9
New function to abstract SO_REUSEADDR.
...
svn:r1102
2009-02-10 19:38:05 +00:00
Nick Mathewson
4d92e4261b
forward-port: Make evdns_resolve_reverse args const.
...
svn:r1096
2009-02-02 19:22:27 +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
Nick Mathewson
9993137cbb
Remove all trailing whitespace in all the source files.
...
svn:r1063
2009-01-27 21:10:31 +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
c0712b1608
Initial documentation for evdns server functions. Also deprecate the one that didn't take an event_base.
...
svn:r1054
2009-01-26 17:29:45 +00:00
Nick Mathewson
bdbd5e0e2f
For every deprecated function, explain why it is deprecated and what you should call instead.
...
svn:r1052
2009-01-26 17:09:37 +00:00
Nick Mathewson
52a75f18e1
Documentation (or more accurate documentation) for a few more functions.
...
svn:r1051
2009-01-26 17:09:22 +00:00