1288 Commits

Author SHA1 Message Date
Nick Mathewson
f22823982f New function to put an SSL bufferevent into a renegotiating state.
svn:r1418
2009-08-14 20:07:35 +00:00
Nick Mathewson
46a61869ca Disable whichever struct event we don't want during ssl handshaking.
svn:r1417
2009-08-14 20:07:17 +00:00
Nick Mathewson
58b0708e18 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
2009-08-14 20:07:09 +00:00
Nick Mathewson
d17c720c05 Remove an extraneous puts().
svn:r1415
2009-08-14 20:07:01 +00:00
Nick Mathewson
eff09a299c tab/whitespace fixes in bufferevent_sock.c
Also note that write() doesn't usually say 0.

svn:r1414
2009-08-14 20:06:48 +00:00
Nick Mathewson
bd26bace0d When running with deferred callbacks, always send the "connected" event
before any read/write events, and send timeout/error/eof events after.

svn:r1413
2009-08-11 19:47:46 +00:00
Nick Mathewson
7a55c48d77 Add a few missing changelog entries
svn:r1412
2009-08-09 20:18:00 +00:00
Nick Mathewson
800f9aa607 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
2009-08-09 20:17:29 +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
d41347722a Refactor evbuffer_readln() into a search-for-eol function and an extract-line function.
svn:r1404
2009-07-31 17:35:42 +00:00
Nick Mathewson
a26d2d1b87 Refactor evbuffer_readln to use evbuffer_ptr; remove old evbuffer_iterator.
svn:r1403
2009-07-31 17:34:47 +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
621aafd27a Export sockaddr comparison functionality.
svn:r1400
2009-07-30 22:11:23 +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
d1a2254bf2 Fix some bugs in bufferevent_socket_connect
svn:r1398
2009-07-30 20:41:31 +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
595f7e3877 Always retry SSL_write() with the same number you told it last time.
svn:r1396
2009-07-30 20:41:12 +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
d5a3f1f116 Set the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag, and explain why.
svn:r1394
2009-07-30 20:40:50 +00:00
Nick Mathewson
44715517e8 Use SSL_do_handshake in place of SSL_connect/SSL_accept
svn:r1393
2009-07-30 20:40:40 +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
7c20a6ae52 Export an ev_socklen_t.
svn:r1391
2009-07-30 17:01:21 +00:00
Nick Mathewson
75fe762e03 Accessor function to get a listener's associated fd
svn:r1390
2009-07-30 17:00:56 +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
3c99c79df9 Changelog entry for msvc fixes.
svn:r1388
2009-07-28 19:45:54 +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
12199fa7a5 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
2009-07-28 17:11:03 +00:00
Nick Mathewson
f8b527e6a1 Fix a dumb bug where we would allocate too little memory in event_get_supported_methods().
svn:r1383
2009-07-28 05:09:06 +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
b06b2649b4 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
2009-07-26 01:29:39 +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
Niels Provos
6fbeb9237c call it 2.0.2-alpha
svn:r1378
2009-07-25 03:23:46 +00:00
Nick Mathewson
8eb155a1c0 Fix build on platforms (like Solaris 10, reportedly) which lack a MAP_FILE.
svn:r1375
2009-07-23 14:48:24 +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
59e8e959dc Add clarifying "static" to definitions of fns in event.c
svn:r1372
2009-07-21 19:20:25 +00:00
Nick Mathewson
670658ebd7 Correct the signatures for evdns_configure_windows_nameservers(), now that it is exposed.
svn:r1369
2009-07-21 18:32:57 +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
1fb2e818a6 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
2009-07-17 21:47:45 +00:00
Nick Mathewson
9cf4ee7e17 Fix a simple warning
svn:r1362
2009-07-17 21:47:35 +00:00
Nick Mathewson
d3bef1a1e3 Finish implementing new convention that whenever an optional function is declared, a corresponding macro is defined.
svn:r1361
2009-07-17 20:32:25 +00:00