894 Commits

Author SHA1 Message Date
Nick Mathewson
68d0139f19 Refactor the zlib and pthreads tests to appear in the regular tinytest tree structure.
svn:r1141
2009-04-07 04:49:25 +00:00
Nick Mathewson
684c022a21 Avoid a double event_del() in evdns.c.
The bug could occur when a nameserver was marked as up, but then an
outstanding probe sent to the nameserver failed.  Now, evdns_up() cancels
any outstanding probe.

svn:r1140
2009-04-06 20:38:42 +00:00
Nick Mathewson
d2e9caa6fc Fix evdns_cancel to alert callback and free associated RAM.
Also, we add a test to make sure evdns_cancel is working properly.

svn:r1139
2009-04-06 20:38:19 +00:00
Nick Mathewson
0f3c0983c0 Fix a double-delete on the request timeout event. Port from Tor.
svn:r1138
2009-04-05 17:50:18 +00:00
Nick Mathewson
28255a2635 Finally, get unit tests to pass with threading turned off again.
svn:r1137
2009-04-05 04:26:46 +00:00
Nick Mathewson
6a18f4b005 Munge the read_suspended flag before re-enabling reads on the underlying bufferevent. This makes it so the enabled thing has some idea whether reads are supposed to be suspended or not.
svn:r1136
2009-04-05 04:15:01 +00:00
Nick Mathewson
661b5eea09 Actually, move EVUTIL_NIL_STMT to util-internal.h
svn:r1135
2009-04-05 04:10:05 +00:00
Nick Mathewson
60e0d59b33 Add locking to evbuffers.
svn:r1134
2009-04-05 02:44:17 +00:00
Nick Mathewson
d13b59ce37 Fix build with thread support disabled, and make no-op macros a little more no-oppy.
svn:r1133
2009-04-05 02:44:04 +00:00
Nick Mathewson
70ee390fc9 Add some more utility macros to evthread-internal.h
svn:r1132
2009-04-05 02:43:55 +00:00
Nick Mathewson
f1b1bad415 Make the new evbuffer callbacks use a new struct-based interface.
The old interface would fail pretty hard when we had to batch up
multiple adds and drains in a single call.

svn:r1131
2009-04-03 14:27:03 +00:00
Nick Mathewson
f90500a5df Add a new improved search function.
The old evbuffer_find didn't allow iterative searching, and forced us
to repack the buffer completely every time we searched in it.  The
new evbuffer_search addresses both of these.  As a side-effect, the
evbuffer_find implementation is now a little more efficient.

svn:r1130
2009-04-03 01:21:36 +00:00
Nick Mathewson
0afb1f7ffb Glibc mkstemp requires exactly 6 Xs.
svn:r1129
2009-04-01 16:08:34 +00:00
Niels Provos
994e85781c correct evbuffer_drain documentation from John Khvatov
svn:r1127
2009-03-30 17:36:22 +00:00
Niels Provos
23655dfb87 include Doxyfile in tar ball; from Jeff Garzik
svn:r1125
2009-03-12 17:43:43 +00:00
Nick Mathewson
73094d5952 Make tmpfile code compile without warnings
svn:r1123
2009-02-13 13:43:35 +00:00
Niels Provos
79b7799bd1 a simple test for evbuffer_add_file
svn:r1122
2009-02-13 01:42:59 +00:00
Nick Mathewson
ec35eb5520 Make threading functions global, like the mm_ functions. Use the libevent_pthread.la library in regress_pthread.
svn:r1121
2009-02-12 22:19:54 +00:00
Nick Mathewson
d0a9c90e93 Fix some of the crazier indentation and tabbing choices in evdns.c
svn:r1120
2009-02-11 17:29:17 +00:00
Nick Mathewson
77c80b8dcf New bind-to option to allow DNS clients to bind to arbitrary ports for their outgoing addresses.
svn:r1119
2009-02-11 17:24:11 +00:00
Nick Mathewson
acaf65c359 Make evutil_parse_sockaddr_port give a useful socket-length output.
svn:r1118
2009-02-11 17:23:32 +00:00
Nick Mathewson
f2a24d6e58 Better comments for some confusing-to-me code.
svn:r1117
2009-02-11 17:22:40 +00:00
Nick Mathewson
c6f4dc987c Port some evdns changes over from Tor.
svn:r1116
2009-02-11 17:21:48 +00:00
Nick Mathewson
ac36f4047e oops; coding too quickly on nil-filter patch. Caught by niels.
svn:r1115
2009-02-11 05:17:27 +00:00
Nick Mathewson
cd731b77d7 Do not use ctypes functions in cases when we need the "net" locale.
This patch adds a new set of EVUTIL_IS* functions to replace use of
the ctypes is* functions in all cases where we care about characters'
interpretations in net ascii rather than in the locale.  For example,
when we're working with DNS hostnames, we don't want to do the 0x20
hack on non-ascii characters, even if the host thinks they should be
isalpha.

svn:r1114
2009-02-10 21:40:12 +00:00
Nick Mathewson
1ed27048e4 Stop rolling our own offsetof twice.
svn:r1113
2009-02-10 21:39:56 +00:00
Nick Mathewson
f04b90e5b3 Make a couple of newer evdns functions more bulletproof.
svn:r1112
2009-02-10 19:43:19 +00:00
Nick Mathewson
da49d6a3b0 Stop using platform inet_aton/inet_addr; they can behave strangely on certain misformed addresses.
svn:r1111
2009-02-10 19:43:11 +00:00
Nick Mathewson
01456265c3 Explode less badly in the case where we're told to prepend/append/remove a buffer to itself. Note some API/implementation deficiencies.
svn:r1110
2009-02-10 19:39:22 +00:00
Nick Mathewson
20f809ce8c Make default (nil) filter use evbuffer_remove_buffer to respect the high-water mark of the target buffer.
svn:r1109
2009-02-10 19:39:12 +00:00
Nick Mathewson
e7fd1034cf Test some formerly untested prepend cases of evbuffer. Now evbuffer coverage is over 80 percent.
svn:r1108
2009-02-10 19:39:03 +00:00
Nick Mathewson
9e3e7b360d More unit tests for evbuffer_add_reference to make sure that certain interleaved data patterns work; that free invokes callback; that callbacks are not invoked too early or later; etc.
svn:r1107
2009-02-10 19:38:54 +00:00
Nick Mathewson
98b7046b97 A few more comments on evbuffer-internal structures.
svn:r1106
2009-02-10 19:38:43 +00:00
Nick Mathewson
edfdb698e3 Add an assertion to evbuffer_chain_align so we can't reuse it in the future.
svn:r1105
2009-02-10 19:38:34 +00:00
Nick Mathewson
71604d85be Remove some needless includes
svn:r1104
2009-02-10 19:38:25 +00:00
Nick Mathewson
deb2a1210b use new evutil_make_listen_socket_reuseable() in http.c
svn:r1103
2009-02-10 19:38:14 +00:00
Nick Mathewson
c7b2f8fdc9 New function to abstract SO_REUSEADDR.
svn:r1102
2009-02-10 19:38:05 +00:00
Nick Mathewson
f9e4e0f98e Move bufferevent tests to regress_bufferevent.c file.
svn:r1101
2009-02-03 18:28:53 +00:00
Nick Mathewson
cc049bfc30 Enable (and debug) WSARecv for evbuffer iovec-like reads.
The two things we were missing: the flags parameter is not optional, and an error can actually indicate a close.

svn:r1100
2009-02-03 05:22:57 +00:00
Nick Mathewson
ea11f8195f Compile http_connection_retry_test, but mark it skipped on win32.
svn:r1099
2009-02-02 22:17:32 +00:00
Nick Mathewson
722885fba9 Some mingws have AF_UNIX, which may have prevented our socketpair from working at all on them. Fix that.
svn:r1098
2009-02-02 21:59:53 +00:00
Nick Mathewson
3502a472b5 convert new bufferevent_*.c files to event-config.h only.
svn:r1097
2009-02-02 21:24:04 +00:00
Nick Mathewson
4d92e4261b forward-port: Make evdns_resolve_reverse args const.
svn:r1096
2009-02-02 19:22:27 +00:00
Nick Mathewson
ea4b8724c0 checkpoint work on big bufferevent refactoring
svn:r1095
2009-02-02 19:22:13 +00:00
Nick Mathewson
e84c765615 Allocate callback entries with contents 0d out.
svn:r1093
2009-02-01 05:26:47 +00:00
Nick Mathewson
2e3f0f682a Enable the edge-triggered test again
svn:r1092
2009-02-01 02:20:16 +00:00
Nick Mathewson
8d3a10f8f1 Support temporarily suspending an evbuffer callback. This is different from disabling the callback, since we want to process changes, but not just yet.
svn:r1091
2009-02-01 01:43:58 +00:00
Nick Mathewson
e3e1153109 Unit tests for evbuffer callback manipulation
svn:r1090
2009-02-01 01:07:42 +00:00
Nick Mathewson
2e50658d8d Fix a typo in buffer.h
svn:r1089
2009-02-01 01:07:33 +00:00
Nick Mathewson
ca37fef951 Change evbuffer callbacks to use tinytest natively and never assert.
svn:r1088
2009-02-01 01:07:22 +00:00