Nick Mathewson
e9ee1057e6
Give event_assign a return value, and make it less inclined to exit().
...
We also refactor event_assign so that it is the core function, and
event_set() is only the wrapper.
svn:r1469
2009-10-27 04:25:45 +00:00
Nick Mathewson
ed0e91e02a
New test flag to suppress logging for one test.
...
svn:r1466
2009-10-27 04:03:50 +00:00
Nick Mathewson
a8267663de
API to replace all calls to exit() with a user-supplied fatal-error handler.
...
Also, add unit tests for logging.
svn:r1462
2009-10-26 19:59:51 +00:00
Nick Mathewson
38aec9ec7c
Tweaks to IOCP interface.
...
svn:r1461
2009-10-23 22:38:35 +00:00
Nick Mathewson
7b10724901
Fix my fix for the bufferevent_connect_fail() test.
...
svn:r1460
2009-10-23 22:07:05 +00:00
Nick Mathewson
879420a711
Expose a narrow window to the IOCP code.
...
svn:r1459
2009-10-23 22:00:29 +00:00
Nick Mathewson
fdd11c00bb
Make the bufferevent_connect_fail test faster on OSX.
...
It seems that connecting to a listener that is bound but not accepting
or listening doesn't give a 'connection refused' error on OSX, but
rather makes the connect() time out after 75 seconds. I couldn't find
any way to make the timout shorter. Fortunately, closing the listener
after a second or so makes the desired error occur after another
second or so.
svn:r1457
2009-10-21 19:21:05 +00:00
Nick Mathewson
4fbac2a5ae
Test failing case of bufferevent_connect().
...
Code by Chris Davis.
svn:r1455
2009-10-21 07:00:19 +00:00
Nick Mathewson
5082546682
Fix windows compilation warnings.
...
svn:r1449
2009-10-21 02:14:16 +00:00
Nick Mathewson
ba8a17714e
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
2009-10-02 03:03:58 +00:00
Niels Provos
8e8d94a3e0
Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec
...
svn:r1436
2009-09-24 22:18:19 +00:00
Nick Mathewson
d17c720c05
Remove an extraneous puts().
...
svn:r1415
2009-08-14 20:07:01 +00:00
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
0c09fe5ada
Add a couple more evdns tests. Libevent is now, for me, at 80.02% coverage.
...
svn:r1409
2009-08-03 20:50:56 +00:00
Nick Mathewson
94e8f9b901
Another DNS unit tests, to handle reissues.
...
The evdns module is now up to ~72% coverage; Libevent is up to nearly 80%.
svn:r1408
2009-08-03 20:15:45 +00:00
Nick Mathewson
dc1f5b1ee0
why say fprintf(stdout, X) when you can say printf?
...
svn:r1407
2009-08-03 20:15:39 +00:00
Nick Mathewson
213dc2a2ef
Fix an annoying evdns crash bug, and add more unit tests for evdns.
...
svn:r1406
2009-08-03 20:15:32 +00:00
Nick Mathewson
a5006d80cd
Unit tests for DNS search.
...
svn:r1405
2009-08-03 16:15:57 +00:00
Nick Mathewson
6dc488bd7e
Improved coverage for evbuffer_readln()
...
svn:r1402
2009-07-31 17:34:18 +00:00
Nick Mathewson
7c688dd9a2
New function to expose bufferevent.enabled
...
svn:r1401
2009-07-31 14:41:45 +00:00
Nick Mathewson
cf54d74a65
More unit tests for Openssl, including initializing with no socket. Up to 75% coverage.
...
svn:r1399
2009-07-30 20:41:41 +00:00
Nick Mathewson
7a2a51a3a1
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
2009-07-30 20:41:21 +00:00
Nick Mathewson
eecefc50e7
Add a function to extract the SSL object from a bufferevent_openssl.
...
svn:r1395
2009-07-30 20:41:00 +00:00
Nick Mathewson
8a3007efb9
More evconnlistener unit tests: bump its coverage from 71% to 83%.
...
svn:r1392
2009-07-30 17:01:38 +00:00
Nick Mathewson
625116295a
Add unit test for parsing addresses with bad ports.
...
svn:r1389
2009-07-30 17:00:46 +00:00
Nick Mathewson
72ea534f8e
Export evutil_str[n]casecmp as evutil_ascii_str[n]casecmp.
...
svn:r1387
2009-07-28 19:41:57 +00:00
Nick Mathewson
a826a75800
Some tweaks to Brodie Thesfield's MSVC patch.
...
svn:r1386
2009-07-28 19:41:48 +00:00
Nick Mathewson
5b5b880be7
Various MSVC cleanups from Brodie Thiesfield.
...
svn:r1385
2009-07-28 19:41:39 +00:00
Nick Mathewson
709c21c48c
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
2009-07-28 04:03:57 +00:00
Nick Mathewson
8cc6883524
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
2009-07-25 03:35:32 +00:00
Nick Mathewson
49de08ef35
Push coverage of event.c a little higher
...
svn:r1373
2009-07-21 19:20:44 +00:00
Nick Mathewson
f4775918cd
Refactor evtag tests into their own suite.
...
svn:r1366
2009-07-20 14:55:51 +00:00
Nick Mathewson
e8400a43ca
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
2009-07-20 14:55:35 +00:00
Nick Mathewson
dc031990e0
Add strcasecmp tests to improve evutil coverage a bit
...
svn:r1364
2009-07-20 14:55:07 +00:00
Nick Mathewson
9cf4ee7e17
Fix a simple warning
...
svn:r1362
2009-07-17 21:47:35 +00:00
Nick Mathewson
c02b305ae5
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
2009-07-17 20:23:12 +00:00
Nick Mathewson
61f2a45de1
Add a tinytest flag to initialize threading.
...
svn:r1357
2009-07-17 20:23:05 +00:00
Nick Mathewson
4ba6eda48f
Make evthread_use_pthreads() actually return 0 on success.
...
svn:r1356
2009-07-17 20:22:56 +00:00
Nick Mathewson
9c2ecba7f8
Oops. -1 is an integer, not a pointer.
...
svn:r1352
2009-07-17 18:42:12 +00:00
Nick Mathewson
d6f2e19924
Unit tests for bufferevent_get(fd|_underlying)
...
svn:r1351
2009-07-17 18:38:46 +00:00
Nick Mathewson
5d71b25b51
Remove all trailing whitespace from end-of-line.
...
svn:r1350
2009-07-17 18:38:38 +00:00
Nick Mathewson
d4e3671fb4
Add a test to free_active_base to free a base with an active event.
...
svn:r1349
2009-07-17 18:38:21 +00:00
Nick Mathewson
043515bc52
Stop using C++ style comments.
...
svn:r1343
2009-07-14 18:50:06 +00:00
Nick Mathewson
e224321c64
Convert and expand free_active_base/event_base_new tests to avoid dbl-free. Patch from Zack Weinberg
...
svn:r1342
2009-07-14 18:49:42 +00:00
Nick Mathewson
d866f05585
Patch from Zack Weinberg: normalize perror() tt functions and add tt_fail/tt_abort_printf
...
svn:r1340
2009-07-13 20:03:00 +00:00
Niels Provos
6469598e56
Allow C identifiers as struct names; allow multiple comments in .rpc files; from Zack Weinberg; plus a tiny tweak
...
svn:r1336
2009-07-03 17:43:26 +00:00
Nick Mathewson
bbd14de053
Add sometimes-needed header to regress_bufferevent.c
...
svn:r1325
2009-06-11 17:55:08 +00:00
Nick Mathewson
d1ffba1d7c
Replace some read/write instances with send/recv to work properly on win32.
...
svn:r1324
2009-06-05 19:52:13 +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
23243b8a98
Replace reserve/commit with new iovec-based interface. Add a new evbuffer_peek.
...
svn:r1296
2009-05-19 21:39:35 +00:00