452 Commits

Author SHA1 Message Date
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
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
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
8910901020 Addition to bufferevent_async unit test
svn:r1279
2009-05-06 02:34:10 +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
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
bd73ed48e5 Revise regress_pthreads.c to not use event_set
svn:r1269
2009-05-02 16:24:23 +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
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
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
Niels Provos
b228ff91b8 remove vararg macros for accessing evrpc structs
svn:r1243
2009-04-25 00:15:31 +00:00
Nick Mathewson
d70b080488 Make main/methods test pass on systems where only one backend exists.
svn:r1235
2009-04-23 18:08:42 +00:00
Nick Mathewson
1ad0326440 Fix win32 compilation issues.
svn:r1234
2009-04-23 18:04:50 +00:00
Nick Mathewson
8ba25b9ec7 Add missing regress_minheap.c file
svn:r1230
2009-04-23 05:20:08 +00:00
Nick Mathewson
5c104cef51 Add a randomized test for heap correctness.
svn:r1229
2009-04-23 00:33:37 +00:00