Nick Mathewson
594842970e
Fix a deadlock: there were some LOCKs that should have been UNLOCKs. Resolves bug 2794244
...
svn:r1298
2009-05-20 12:24:13 +00:00
Nick Mathewson
66df9dafe1
Add changelog for last commit
...
svn:r1297
2009-05-19 21:49:53 +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
ed1bbc7a9f
Tweak the evconnlistener interface a little.
...
svn:r1295
2009-05-18 16:15:56 +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
b4886ec80d
Trim 22 bytes from struct event on 32 bit platforms, more on 64-bit platforms.
...
svn:r1292
2009-05-15 18:44:44 +00:00
Nick Mathewson
85b0a7a23f
We were distributing the wrong event-config.h with our source distributions. Fix that.
...
svn:r1289
2009-05-15 01:38:23 +00:00
Nick Mathewson
27fef1ef26
Note problems with some newer evbuffer interfaces.
...
svn:r1286
2009-05-14 18:06:41 +00:00
Nick Mathewson
3e759a0172
Actually, do not provide a compatibility name "EVBUFFER_CONNECTED": there is no old code that uses it.
...
svn:r1285
2009-05-14 18:06:29 +00:00
Nick Mathewson
31d89f274b
Add a "ctrl" mechanism to bufferevents for property access.
...
OpenSSL uses something like this to implement get/set access for
properties on its BIOs, so that it doesn't need to add a pair of
get/set functions to the vtable struct for every new abstract property
it provides an accessor for.
Doing this lets us make bufferevent_setfd abstract, and implement an
abstract bufferevent_getfd.
svn:r1284
2009-05-13 20:37:21 +00:00
Nick Mathewson
83f46e51d7
Do not use the "evbuffer_" prefix to denote parts of bufferevents.
...
This is a bit of an interface doozy, but it's really needed in order
to be able to document this stuff without apologizing it. This patch
does the following renamings:
evbuffercb -> bufferevent_data_cb
everrorcb -> bufferevent_event_cb
EVBUFFER_(READ,WRITE,...) -> BEV_EVENT_(...)
EVBUFFER_(INPUT,OUTPUT) -> bufferevent_get_(input,output)
All the old names are available in event2/bufferevent_compat.h
svn:r1283
2009-05-13 20:36:56 +00:00
Nick Mathewson
f11dff2c7a
Add and use locale-independent strcasecmp functions.
...
svn:r1280
2009-05-07 03:45:51 +00:00
Nick Mathewson
8910901020
Addition to bufferevent_async unit test
...
svn:r1279
2009-05-06 02:34:10 +00:00
Nick Mathewson
a8bcbfd416
Fix bufferevent_async to use lock/unlock, not unlock/unlock.
...
You do NOT want to know what windows does when you unlock a lock that is already unlocked.
svn:r1278
2009-05-06 02:33:37 +00:00
Nick Mathewson
fe47003d06
Make unit tests for bufferevent_async compile and _almost_ work.
...
Either I need to make the callbacks get deferred in a base with no events (doable), or I need to make it okay to call launch_read from inside the callback for read (tricky).
svn:r1277
2009-05-05 16:52:37 +00:00
Nick Mathewson
02801e5be5
Add a trival start of a be_async test.
...
svn:r1276
2009-05-05 15:36:28 +00:00
Nick Mathewson
af8b82224b
Add missing include to buffer_iocp.c
...
svn:r1275
2009-05-05 15:30:58 +00:00
Nick Mathewson
b69d03b5a8
Add a constructor for bufferevent_async.
...
svn:r1274
2009-05-05 14:18:14 +00:00
Nick Mathewson
6b21fe2be8
oops; do not forget to distribute listener.h
...
svn:r1273
2009-05-05 03:01:24 +00:00
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
0e63e72a05
Nothing ever sets event_sigcb or event_gotsig any more: remove them.
...
svn:r1270
2009-05-03 18:56:08 +00:00
Nick Mathewson
bd73ed48e5
Revise regress_pthreads.c to not use event_set
...
svn:r1269
2009-05-02 16:24:23 +00:00
Nick Mathewson
5a3eddf03f
Use fewer _compat.h headers in our own code.
...
svn:r1268
2009-05-02 16:24:05 +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
00ecd1d8e4
Make evrpc use event2/rpc*.h, not evrpc.h
...
svn:r1266
2009-05-02 16:23:08 +00:00
Nick Mathewson
7b24d72ad6
Remove some duplicated includes in evdns.c
...
svn:r1265
2009-05-02 16:22:55 +00:00
Nick Mathewson
a109d95c72
Add changelog entry for vc++ fixes
...
svn:r1264
2009-05-02 16:11:06 +00:00
Nick Mathewson
1aebcd5047
Initial core implementation of bufferevent_async.c
...
svn:r1263
2009-05-01 01:42:33 +00:00
Nick Mathewson
e865eb938c
More msvc build tweaks.
...
svn:r1262
2009-05-01 00:54:14 +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
ebf294559e
Compilation fixes for vc++ 2008 express. Not the end of them.
...
svn:r1260
2009-04-30 23:49:15 +00:00
Nick Mathewson
7f9678079f
Initial unit test for overlapped evbuffer usage. It's lame, but it doesn't crash any more.
...
svn:r1259
2009-04-30 20:48:40 +00:00
Nick Mathewson
efc24f7cf1
Get launch_read and launch_write to (apparently) work.
...
svn:r1258
2009-04-30 20:47:38 +00:00
Nick Mathewson
23121bfb41
Fix a reversed check in upcast_evbuffer
...
svn:r1257
2009-04-30 19:56:23 +00:00
Nick Mathewson
16612eb936
Beef up the events in the last test a little.
...
svn:r1256
2009-04-30 19:20:42 +00:00
Nick Mathewson
ec1468832e
Oops: actually commit changes to build and use regress_iocp
...
svn:r1255
2009-04-30 19:05:43 +00:00
Nick Mathewson
f1090833b2
First tests for IOCP loop, and related fixes.
...
The fixes are: a shutdown mode that works, and a way to activate an
arbitrary event_overlapped.
svn:r1254
2009-04-30 19:04:44 +00:00
Nick Mathewson
b45cead762
Make environment-variable tests work on win32, which has only one method and lacks (un)setenv.
...
svn:r1253
2009-04-30 18:05:33 +00:00
Nick Mathewson
24607a397c
Note a place we might do better about lock releasing.
...
svn:r1252
2009-04-29 20:48:43 +00:00
Nick Mathewson
50e20fe076
fix a typo in a comment
...
svn:r1251
2009-04-29 20:48:35 +00:00
Nick Mathewson
37bc34662b
Catch attempts to event_base_once a persistent event.
...
svn:r1250
2009-04-29 20:48:28 +00:00
Nick Mathewson
1959414120
Clarify semantics on event_pending()
...
svn:r1249
2009-04-29 20:48:21 +00:00
Nick Mathewson
9ad45eef75
Patch from Eric Hopper: the test for EVENT_BASE_FLAG_IGNORE_ENV was inverted.
...
svn:r1248
2009-04-28 19:08:36 +00:00
Nick Mathewson
586aa46886
Unit test for disabling events with EVENT_NO*, and for EVENT_BASE_FLAG_IGNORE_ENV.
...
svn:r1247
2009-04-28 19:08:27 +00:00
Nick Mathewson
2ebfd3bafd
Oops. We never actually defined event_config_set_flag().
...
svn:r1246
2009-04-28 19:08:17 +00:00
Nick Mathewson
11cab33418
Fix compile: #elif FOO is not the same as #elif defined(FOO).
...
svn:r1245
2009-04-28 19:08:07 +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