Log

Author Commit Date CI Message
Nick Mathewson c9c4ec26 2009-10-21T05:36:27 Remove an EVBASE_RELEASE_LOCK that I missed. svn:r1452
Nick Mathewson ed748a48 2009-10-21T04:45:59 Fix win32 compilation. svn:r1451
Nick Mathewson 6b22e74a 2009-10-21T03:54:00 Add locking to event_base_loop. This is harder than it sounds, since we need to make sure to release the lock around the key call to the kernel (e.g., select, epoll_wait, kevent), AND we need to make sure that none of the fields that are used in that call are touched by anything that might be running concurrently in another thread. I managed to do this pretty well for everything but poll(). With poll, I needed to introduce a copy of the event_set structure. This patch also fixes a bug in win32.c where we called realloc() instead of mm_realloc(). svn:r1450
Nick Mathewson 50825466 2009-10-21T02:14:16 Fix windows compilation warnings. svn:r1449
Niels Provos e1c9b84a 2009-10-19T16:20:12 Fix compilation for listener.h for C++ - missing extern "C". Patch from Ferenc Szalai. svn:r1448
Nick Mathewson b812563a 2009-10-16T13:20:16 Add a note that we should change previous_to_last to last_with_space svn:r1447
Nick Mathewson f3dee9e8 2009-10-16T13:20:09 Correct the signatures for the evmap_io_* functions to use evutil_socket_t. svn:r1446
Nick Mathewson e3fd294a 2009-10-16T13:19:57 Spelling fixes in comments and strings. svn:r1445
Nick Mathewson 25af6954 2009-10-14T00:46:47 When a bufferevent_connect() call fails, give the client an error callback. Patch from Christopher Davis. svn:r1444
Nick Mathewson fc83ca3c 2009-10-14T00:46:40 Fix some crash bugs when initializing evdns svn:r1443
Nick Mathewson e6b747c3 2009-10-12T21:06:30 Declare struct timezone in util.h so that borken mingw versions do not complain svn:r1441
Nick Mathewson 633f3fb7 2009-10-02T03:07:29 Add changelog for last commit svn:r1440
Nick Mathewson ba8a1771 2009-10-02T03:03:58 Do not notify the main thread more than needed. Basically, we suppress the notification when an event is added or deleted and: - The event has no fd, or there is no change in whether we are reading/writing on the event's fd. - The event has no timeout, or adding the event did not make the earliest timeout become earlier. This should be a big efficiency win in applications with multiple threads and lots of timeouts. svn:r1439
Nick Mathewson d5b640fc 2009-10-01T15:29:08 Apply Ka-Hing Cheung's event_base_got_[break|exit] patch, with locking and whitespace fixes. svn:r1438
Niels Provos 8e8d94a3 2009-09-24T22:18:19 Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec svn:r1436
Nick Mathewson 18fe4008 2009-09-23T23:51:26 Forward-port: fix android compilation svn:r1435
Nick Mathewson 2622e5ac 2009-09-16T17:17:57 Fix the assert I added to epoll.c: spotted by Dmitry Novikov svn:r1432
Nick Mathewson c2ead9f1 2009-09-11T21:02:19 Treat events with fd == -1 as addable. This turns out to simplify a fair bit of logic, including the bufferevent code, and should fix bug 2850656. svn:r1431
Nick Mathewson 85255a63 2009-09-11T18:47:35 Make epoll use less RAM. We do this by not allocating the maximum epoll_event array for the epoll backend at startup. Instead, we start out accepting 32 events at a time, and double the array's size when it seems that the OS is generating events faster than we're requesting them. This saves up to 374K per epoll-based event_base. Resolves bug 2839240. svn:r1428
Nick Mathewson e3f89fa2 2009-09-11T18:21:57 Add a trivial race-fix from Chromium: do not try to re-detect whether we have a monotonic clock every time we make a new event_base. svn:r1427
Nick Mathewson 3b461a6d 2009-09-11T18:21:37 Treat a negative number of bytes to read as the kernel saying "I don't know." svn:r1426
Nick Mathewson f65b8b09 2009-08-19T20:55:25 On connect, call only one of BEV_EVENT_CONNECTED or writecb. Previously, if we had a socket bufferevent in connect state, we'd send both of these to indicate that the connection was done. That was broken since the point of adding BEV_EVENT_CONNECTED was so that we could distinguish "we're connected" and "we wrote something". Now, writecb is called only when A) the connection finished but the user never put the socket into a "connecting" state, or B) data was actually written. svn:r1425
Nick Mathewson 2c1b0e44 2009-08-16T19:22:15 Fix build warnings and add changelog entry for evhttp patches. svn:r1424
Nick Mathewson c8b0fe4a 2009-08-16T19:22:10 Define evhttp_del_accept_socket [Patch from David Reiss] svn:r1423
Nick Mathewson 6c53334c 2009-08-16T19:22:04 Define evhttp_{bind,accept}_socket_with_handle [Patch from David Reiss] svn:r1422
Nick Mathewson 4bcd5646 2009-08-16T19:21:57 Make evhttp_bound_socket visible, and provide an accessor to its fd Declare the previously private struct evhttp_bound_socket in event2/http.h as an opaque struct. Implement evhttp_bound_socket_get_fd, which returns the file descriptor of an evhttp_bound_socket. [Patch from David Reiss] svn:r1421
Nick Mathewson 0755833e 2009-08-16T19:21:50 Minor documentation fixes [Patch from David Reiss] svn:r1420
Nick Mathewson 22bd5b42 2009-08-16T16:40:42 Support sendfile on solaris: patch from Caitlin Mercer. svn:r1419
Nick Mathewson f2282398 2009-08-14T20:07:35 New function to put an SSL bufferevent into a renegotiating state. svn:r1418
Nick Mathewson 46a61869 2009-08-14T20:07:17 Disable whichever struct event we don't want during ssl handshaking. svn:r1417
Nick Mathewson 58b0708e 2009-08-14T20:07:09 Only send a connected event _after_ we've adjusted the SSL state. This is important if the callback adjusts it to something else. svn:r1416
Nick Mathewson d17c720c 2009-08-14T20:07:01 Remove an extraneous puts(). svn:r1415
Nick Mathewson eff09a29 2009-08-14T20:06:48 tab/whitespace fixes in bufferevent_sock.c Also note that write() doesn't usually say 0. svn:r1414
Nick Mathewson bd26bace 2009-08-11T19:47:46 When running with deferred callbacks, always send the "connected" event before any read/write events, and send timeout/error/eof events after. svn:r1413
Nick Mathewson 7a55c48d 2009-08-09T20:18:00 Add a few missing changelog entries svn:r1412
Nick Mathewson 800f9aa6 2009-08-09T20:17:29 When bufferevent_socket_connect is called with no address, assume that our existing fd is connecting and put the connection into "connecting" mode. svn:r1411
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 0c09fe5a 2009-08-03T20:50:56 Add a couple more evdns tests. Libevent is now, for me, at 80.02% coverage. svn:r1409
Nick Mathewson 94e8f9b9 2009-08-03T20:15:45 Another DNS unit tests, to handle reissues. The evdns module is now up to ~72% coverage; Libevent is up to nearly 80%. svn:r1408
Nick Mathewson dc1f5b1e 2009-08-03T20:15:39 why say fprintf(stdout, X) when you can say printf? svn:r1407
Nick Mathewson 213dc2a2 2009-08-03T20:15:32 Fix an annoying evdns crash bug, and add more unit tests for evdns. svn:r1406
Nick Mathewson a5006d80 2009-08-03T16:15:57 Unit tests for DNS search. svn:r1405
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 a26d2d1b 2009-07-31T17:34:47 Refactor evbuffer_readln to use evbuffer_ptr; remove old evbuffer_iterator. svn:r1403
Nick Mathewson 6dc488bd 2009-07-31T17:34:18 Improved coverage for evbuffer_readln() svn:r1402
Nick Mathewson 7c688dd9 2009-07-31T14:41:45 New function to expose bufferevent.enabled svn:r1401
Nick Mathewson 621aafd2 2009-07-30T22:11:23 Export sockaddr comparison functionality. svn:r1400
Nick Mathewson cf54d74a 2009-07-30T20:41:41 More unit tests for Openssl, including initializing with no socket. Up to 75% coverage. svn:r1399
Nick Mathewson d1a2254b 2009-07-30T20:41:31 Fix some bugs in bufferevent_socket_connect svn:r1398
Nick Mathewson 7a2a51a3 2009-07-30T20:41:21 Add unit tests for SSL session renegotiation. This tickles the write-blocked-on-read code, and in this case turned up a bug in it. svn:r1397
Nick Mathewson 595f7e38 2009-07-30T20:41:12 Always retry SSL_write() with the same number you told it last time. svn:r1396
Nick Mathewson eecefc50 2009-07-30T20:41:00 Add a function to extract the SSL object from a bufferevent_openssl. svn:r1395
Nick Mathewson d5a3f1f1 2009-07-30T20:40:50 Set the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag, and explain why. svn:r1394
Nick Mathewson 44715517 2009-07-30T20:40:40 Use SSL_do_handshake in place of SSL_connect/SSL_accept svn:r1393
Nick Mathewson 8a3007ef 2009-07-30T17:01:38 More evconnlistener unit tests: bump its coverage from 71% to 83%. svn:r1392
Nick Mathewson 7c20a6ae 2009-07-30T17:01:21 Export an ev_socklen_t. svn:r1391
Nick Mathewson 75fe762e 2009-07-30T17:00:56 Accessor function to get a listener's associated fd svn:r1390
Nick Mathewson 62511629 2009-07-30T17:00:46 Add unit test for parsing addresses with bad ports. svn:r1389
Nick Mathewson 3c99c79d 2009-07-28T19:45:54 Changelog entry for msvc fixes. svn:r1388
Nick Mathewson 72ea534f 2009-07-28T19:41:57 Export evutil_str[n]casecmp as evutil_ascii_str[n]casecmp. svn:r1387
Nick Mathewson a826a758 2009-07-28T19:41:48 Some tweaks to Brodie Thesfield's MSVC patch. svn:r1386
Nick Mathewson 5b5b880b 2009-07-28T19:41:39 Various MSVC cleanups from Brodie Thiesfield. svn:r1385
Nick Mathewson 12199fa7 2009-07-28T17:11:03 Fix segfault during failed allocatino of locked evdns base. We need to comb the rest of the code to make sure that we don't blindly wrap functions in LOCK(x), UNLOCK(x) when those functions might contain a FREE(x) in the middle. Rocco Carbone found and reported this bug. svn:r1384
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