Log

Author Commit Date CI Message
Nick Mathewson f8b527e6 2009-07-28T05:09:06 Fix a dumb bug where we would allocate too little memory in event_get_supported_methods(). svn:r1383
Nick Mathewson 709c21c4 2009-07-28T04:03:57 Bufferevent support for openssl. This code adds a new Bufferevent type that is only compiled when the openssl library is present. It supports using an SSL object and an event alert mechanism, which can either be an fd or an underlying bufferevent. There is still more work to do: the unit tests are incomplete, and we need to support flush and shutdown much better. Sometimes events are generated needlessly: this will hose performance. There's a new encrypting proxy in sample/le-proxy.c. This code has only been tested on OSX, and nowhere else. svn:r1382
Nick Mathewson b06b2649 2009-07-26T01:29:39 Make "deferred callback queue" independent of event_base. This way, we can more easily have an IOCP bufferevent implementation that does not need an event_base at all. Woot. svn:r1381
Nick Mathewson 8cc68835 2009-07-25T03:35:32 Fix the main/methods unit test to pass from "make verify". The problem was introduced when we changed the semantics of get_supported_methods() to reflect all the methods that exist. Previously, it had not returned methods disabled from the environment, but the test didn't know that. svn:r1379
Niels Provos 6fbeb923 2009-07-25T03:23:46 call it 2.0.2-alpha svn:r1378
Nick Mathewson 8eb155a1 2009-07-23T14:48:24 Fix build on platforms (like Solaris 10, reportedly) which lack a MAP_FILE. svn:r1375
Nick Mathewson 49de08ef 2009-07-21T19:20:44 Push coverage of event.c a little higher svn:r1373
Nick Mathewson 59e8e959 2009-07-21T19:20:25 Add clarifying "static" to definitions of fns in event.c svn:r1372
Nick Mathewson 670658eb 2009-07-21T18:32:57 Correct the signatures for evdns_configure_windows_nameservers(), now that it is exposed. svn:r1369
Nick Mathewson f4775918 2009-07-20T14:55:51 Refactor evtag tests into their own suite. svn:r1366
Nick Mathewson e8400a43 2009-07-20T14:55:35 Rename encode_int(64) to avoid polluting the global namespace. They're now called evtag_encode_int(64). The old names are available as macros in event2/tag_compat.h. Also, add unit tests for encode/decode_int64. svn:r1365
Nick Mathewson dc031990 2009-07-20T14:55:07 Add strcasecmp tests to improve evutil coverage a bit svn:r1364
Nick Mathewson 1fb2e818 2009-07-17T21:47:45 Use a uniform strategy when a function is not working: do not expose it. Rather than failing at runtime, it is better to fail at compile or link time. svn:r1363
Nick Mathewson 9cf4ee7e 2009-07-17T21:47:35 Fix a simple warning svn:r1362
Nick Mathewson d3bef1a1 2009-07-17T20:32:25 Finish implementing new convention that whenever an optional function is declared, a corresponding macro is defined. svn:r1361
Nick Mathewson a386fde3 2009-07-17T20:28:03 Checking for MS_WINDOWS rather than WIN32 is a Tor-ism. Fix that! svn:r1360
Nick Mathewson c02b305a 2009-07-17T20:23:12 Trivial tests to exercise deferred and locking bufferevent code. These are done as variations of test_bufferevent_connect, since that one exercises event callbacks as well as read/write callbacks. The coverage for bufferevent.c is now up to about 87%, from about 70%. svn:r1358
Nick Mathewson 61f2a45d 2009-07-17T20:23:05 Add a tinytest flag to initialize threading. svn:r1357
Nick Mathewson 4ba6eda4 2009-07-17T20:22:56 Make evthread_use_pthreads() actually return 0 on success. svn:r1356
Nick Mathewson ed038295 2009-07-17T20:22:48 Define a macro to indicate that we have defined one of the optional evthread_use macros svn:r1355
Nick Mathewson 69601fc2 2009-07-17T18:59:22 Update event_tv when time jumps backwards, so that we only note each jump once. Fix for 1939984 svn:r1353
Nick Mathewson 9c2ecba7 2009-07-17T18:42:12 Oops. -1 is an integer, not a pointer. svn:r1352
Nick Mathewson d6f2e199 2009-07-17T18:38:46 Unit tests for bufferevent_get(fd|_underlying) svn:r1351
Nick Mathewson 5d71b25b 2009-07-17T18:38:38 Remove all trailing whitespace from end-of-line. svn:r1350
Nick Mathewson d4e3671f 2009-07-17T18:38:21 Add a test to free_active_base to free a base with an active event. svn:r1349
Nick Mathewson 638116ca 2009-07-17T18:38:14 Add a check for event_add failure to evthread_make_base_notifiable() svn:r1348
Nick Mathewson a62283a9 2009-07-17T17:46:17 Always hold a reference to a bufferevent when calling its callbacks. Rationale: we hold a lock on the bufferevent when its callbacks are executing, so we need to release the lock afterwards. But the callback might free the bufferevent, so unless we're holding a reference on the bufferevent, the lock might not be there for us to release. svn:r1347
Nick Mathewson e83a32df 2009-07-14T19:31:20 Do not define _FORTIFY_SOURCE if the platform GCC already defined it for us. svn:r1346
Nick Mathewson 9fcd84d1 2009-07-14T19:19:45 Include disabled methods in event_get_supported_methods() output. Previously, events that were disabled using EVENT_NO* were left out of event_get_supported_methods(). This was wrong, broke unit tests (under some circumstances) and left the user with no good way to tell which methods were actually compiled in. Fixes bug 2821015. svn:r1344
Nick Mathewson 043515bc 2009-07-14T18:50:06 Stop using C++ style comments. svn:r1343
Nick Mathewson e224321c 2009-07-14T18:49:42 Convert and expand free_active_base/event_base_new tests to avoid dbl-free. Patch from Zack Weinberg svn:r1342
Nick Mathewson 6b4b77a2 2009-07-14T16:54:48 Make event_del(E) block while E is running in another thread. This gives you the property that once you have called event_del(E), you know that E is no longer running or pending or active at all, and so it is safe to delete the resource used by E's callback. svn:r1341
Nick Mathewson d866f055 2009-07-13T20:03:00 Patch from Zack Weinberg: normalize perror() tt functions and add tt_fail/tt_abort_printf svn:r1340
Nick Mathewson 0cc10e41 2009-07-13T20:02:49 Use -version-info, not -release. Patch from Zack Weinberg. His description: This one might be a little more controversial. Libtool's -release and -version-info options are supposed to be mutually exclusive, but it doesn't either enforce that or make it sufficiently clear in the manual. Using both makes the -version-info switch ineffective; you will get sonames like "libevent-2.0.so.1", "libevent-2.1.so.1", etc., even though version 2.1 will presumably be backward ABI compatible with 2.0. This patch just takes out the -release switches and bumps the -version-info value to 2:0:0 so that people looking at the files in /usr/lib will not be confused (it'll be "libevent.so.2"). This does change the soname, but the current release is labeled an alpha, and it would be better to stop using both switches as soon as possible, before someone over at libtool headquarters decides to enforce the mutual exclusivity here... Note that libevent_pthreads is not being linked with any versioning switches I didn't change that because I wasn't sure whether it was intentional. svn:r1339
Nick Mathewson d3a8ccb8 2009-07-10T19:38:16 Change use of AC_CHECK_LIB to AC_SEARCH_LIBS. Patch from Zack Weinberg. His message: This one eliminates all use of AC_CHECK_LIB in the configure script. AC_CHECK_LIB has a serious flaw: if the library you mention *exists* but is not *necessary* for the function you want, it adds it to $(LIBS) anyway. This was fine in the days of static libraries, because the linker would ignore an .a library that didn't contain anything you needed. However, ELF shared libraries are different (let's not get into why): the linker will by default record a DT_NEEDED entry for every shared object mentioned on the link command line. Thus, every use of AC_CHECK_LIB is a potential unnecessary DT_NEEDED, making extra work for the dynamic loader. The cure is simply to use AC_SEARCH_LIBS instead; it first tries to find the function you ask for in libc, and only if that doesn't work does it try to use the extra library you mention. For the same reasons, pkg-config .pc files should distinguish between the libraries to use for shared linkage (Libs:) and the additional libraries needed for static linkage (Libs.private:). I have also made that correction in this patch. I also took the opportunity to clean up the substitution variables a little and make absolutely sure that the core library does not get linked against zlib. svn:r1338
Nick Mathewson a501d683 2009-07-10T19:34:00 Add a lock/unlock pair inside the event callbacks in bufferevents. This fixes part of bug 2800642, I believe, though there is still a general race condition in multithreaded use of events that we need to think about. svn:r1337
Niels Provos 6469598e 2009-07-03T17:43:26 Allow C identifiers as struct names; allow multiple comments in .rpc files; from Zack Weinberg; plus a tiny tweak svn:r1336
Niels Provos fbb181d1 2009-07-03T17:31:17 Allow specifying the output filename for rpcgen; based on work by jmansion; patch from Zack Weinberg. svn:r1335
Niels Provos bbcc54ef 2009-07-03T17:25:45 fix preamble of rpcgen-generated files to rely on event2 includes; based on work by jmansion; patch from Zack Weinberg. svn:r1334
Niels Provos 37d3e16c 2009-07-03T17:20:56 Raise RpcGenError in event_rpcgen.py; from jmanison and Zack Weinberg svn:r1333
Nick Mathewson 342ad355 2009-06-30T14:23:18 The truncated bit is in the 3rd byte of a dns reply, not the 4th. [fwd-port] svn:r1332
Nick Mathewson 5aefb8a6 2009-06-25T15:22:36 Fix type on freebsd sendfile. Patch from navin seshadri. Fixes bug 2811991 svn:r1330
Nick Mathewson f901f986 2009-06-24T22:40:15 When our IP address changes, do not break all existing dns server sockets. Patch from Christopher Davis svn:r1329
Nick Mathewson 01be8708 2009-06-11T19:09:08 Fix compile on cygwin. This isnt the solution I would like: I would prefer to get pton and ntop to work even when AF_INET6 is not defined. svn:r1326
Nick Mathewson bbd14de0 2009-06-11T17:55:08 Add sometimes-needed header to regress_bufferevent.c svn:r1325
Nick Mathewson d1ffba1d 2009-06-05T19:52:13 Replace some read/write instances with send/recv to work properly on win32. svn:r1324
Nick Mathewson a43a1c2b 2009-05-28T20:44:04 Fix compilation problems in win32.c svn:r1322
Nick Mathewson eb97bb76 2009-05-28T15:58:28 Make the headers compile happily with pedantic C compilers. Original message from SF patch 2797966: While commas at the end of enumerator lists are valid in c99, they are not valid +in c89 nor in c++. When using gcc/g++ with the -pedantic flag, users will +receive a warning (gcc) or an error(g++) when including the event2/event.h and +event2/bufferevent.h. The errors look something like event2/event.h:159: error: comma at end of enumerator list Patch from Akita Noek on Sourceforge. svn:r1321
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 cdaca02c 2009-05-27T15:35:00 Activate fd events in a pseudorandom order on older backends. New backends like poll and kqueue and so on add fds to the queue in the order that they are triggered. But the select backend currently activates low-numbered fds first, whereas the poll and win32 backends currently favor whatever fds have been on for the longest. This is no good for fairness. svn:r1318
Nick Mathewson 11a178f2 2009-05-25T23:11:31 Defer EOF on paired bufferevent correctly. svn:r1317
Nick Mathewson 5232cfa3 2009-05-25T23:11:20 Consistently say "eventcb" instead of "errorcb" svn:r1316
Nick Mathewson 2f655f00 2009-05-25T23:10:47 Add documentation for bufferevent-internal.h stuff svn:r1315
Nick Mathewson 34574db0 2009-05-25T23:10:23 Add a generic mechanism to implement timeouts in bufferevents. Paired and asynchronous bufferevents didn't do timeouts, and filtering bufferevents gave them funny semantics. Now they all should all work in a way consistent with what socket bufferevents do now: a [read/write] timeout triggers if [reading/writing] is enabled, and if the timeout is set, and the right amount of time passes without any data getting [added to the input buffer/drained from the output buffer]. svn:r1314
Nick Mathewson 49f18a0a 2009-05-25T20:02:51 Add requirement in configure.in for autoconf 2.59c. Needed for ssize_t test. Spotted by Yang Hong. svn:r1313
Nick Mathewson dfe321e1 2009-05-22T20:11:29 Add missing windows include in time-test.c svn:r1311
Nick Mathewson e8343e9f 2009-05-22T19:11:59 work around missing __func__ in sample code svn:r1310
Nick Mathewson 0b22ca19 2009-05-22T19:11:48 Use ev_ssize_t in place of ssize_t *everywhere*. svn:r1309
Nick Mathewson 7289d7f8 2009-05-22T18:20:59 Fix a potentially very annoying evdns bug that we found in Tor. Generally speaking, it way better to event_assign() an event when you allocate it than to assign it before every time you event_add it: if it is already event_add()ed, the assign will mess it up so that it doesn't _look_ added, and event_add() will insert a second copy. Later, event_del() will only delete the second copy. Eventually, the event_base will have a dangling pointer to freed memory. Ouch! svn:r1307
Nick Mathewson 7a844735 2009-05-22T17:20:05 Fix some small win32 build issues on trunk. svn:r1306
Nick Mathewson 8c66eb2e 2009-05-22T14:48:40 Try to contain the failure when we are running without socketpair(). Some win32 systems (mostly those using Kaspersky, it would seem) prevent us from faking socketpair(). This makes our signal notification code just not work. Our response since 1.4 has been to assert. For users who would rather work without signals than not work at all, this has been a regression from 1.3e. This patch makes adding signal events fail in this case; there's no reason to kill the whole process. svn:r1303
Nick Mathewson 59cd4936 2009-05-22T14:31:07 Do not free the event base lock until we are done removing all the events. Spotted by Joachim Bauch; fixes bug 2795402. svn:r1302
Nick Mathewson 1ee65b7f 2009-05-21T20:59:17 Do not assume we know the value for FD_CLOEXEC. svn:r1301
Nick Mathewson 7e3ea82e 2009-05-21T20:59:09 Disallow backlog==0 in evconnlistener_new_bind(). svn:r1300
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 59484297 2009-05-20T12:24:13 Fix a deadlock: there were some LOCKs that should have been UNLOCKs. Resolves bug 2794244 svn:r1298
Nick Mathewson 66df9daf 2009-05-19T21:49:53 Add changelog for last commit svn:r1297
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 ed1bbc7a 2009-05-18T16:15:56 Tweak the evconnlistener interface a little. svn:r1295
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 b4886ec8 2009-05-15T18:44:44 Trim 22 bytes from struct event on 32 bit platforms, more on 64-bit platforms. svn:r1292
Nick Mathewson 85b0a7a2 2009-05-15T01:38:23 We were distributing the wrong event-config.h with our source distributions. Fix that. svn:r1289
Nick Mathewson 27fef1ef 2009-05-14T18:06:41 Note problems with some newer evbuffer interfaces. svn:r1286
Nick Mathewson 3e759a01 2009-05-14T18:06:29 Actually, do not provide a compatibility name "EVBUFFER_CONNECTED": there is no old code that uses it. svn:r1285
Nick Mathewson 31d89f27 2009-05-13T20:37:21 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
Nick Mathewson 83f46e51 2009-05-13T20:36:56 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
Nick Mathewson f11dff2c 2009-05-07T03:45:51 Add and use locale-independent strcasecmp functions. svn:r1280
Nick Mathewson 89109010 2009-05-06T02:34:10 Addition to bufferevent_async unit test svn:r1279
Nick Mathewson a8bcbfd4 2009-05-06T02:33:37 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
Nick Mathewson fe47003d 2009-05-05T16:52:37 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
Nick Mathewson 02801e5b 2009-05-05T15:36:28 Add a trival start of a be_async test. svn:r1276
Nick Mathewson af8b8222 2009-05-05T15:30:58 Add missing include to buffer_iocp.c svn:r1275
Nick Mathewson b69d03b5 2009-05-05T14:18:14 Add a constructor for bufferevent_async. svn:r1274
Nick Mathewson 6b21fe2b 2009-05-05T03:01:24 oops; do not forget to distribute listener.h svn:r1273
Nick Mathewson 659d54d5 2009-05-05T02:59:26 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
Nick Mathewson 0fd70978 2009-05-05T01:09:03 Add an event_get_base() function to remove one more reason to include event_struct.h svn:r1271
Nick Mathewson 0e63e72a 2009-05-03T18:56:08 Nothing ever sets event_sigcb or event_gotsig any more: remove them. svn:r1270
Nick Mathewson bd73ed48 2009-05-02T16:24:23 Revise regress_pthreads.c to not use event_set svn:r1269
Nick Mathewson 5a3eddf0 2009-05-02T16:24:05 Use fewer _compat.h headers in our own code. svn:r1268
Nick Mathewson d5ca0763 2009-05-02T16:23:29 Move event_set() and friends to event2/event_compat.h. These functions are deprecated in favor of event_assign(). svn:r1267
Nick Mathewson 00ecd1d8 2009-05-02T16:23:08 Make evrpc use event2/rpc*.h, not evrpc.h svn:r1266
Nick Mathewson 7b24d72a 2009-05-02T16:22:55 Remove some duplicated includes in evdns.c svn:r1265
Nick Mathewson a109d95c 2009-05-02T16:11:06 Add changelog entry for vc++ fixes svn:r1264
Nick Mathewson 1aebcd50 2009-05-01T01:42:33 Initial core implementation of bufferevent_async.c svn:r1263
Nick Mathewson e865eb93 2009-05-01T00:54:14 More msvc build tweaks. svn:r1262
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 ebf29455 2009-04-30T23:49:15 Compilation fixes for vc++ 2008 express. Not the end of them. svn:r1260
Nick Mathewson 7f967807 2009-04-30T20:48:40 Initial unit test for overlapped evbuffer usage. It's lame, but it doesn't crash any more. svn:r1259