431 Commits

Author SHA1 Message Date
Niels Provos
d475fb5861 http benchmark: add a way to change the size of the buffer; also use add_reference
svn:r1158
2009-04-12 00:38:31 +00:00
Nick Mathewson
23085c9247 Add a linked-pair abstraction to bufferevents.
The new bufferevent_pair abstraction works like a set of buferevent_sockets
connected by a socketpair, except that it doesn't require a socketpair,
and therefore doesn't need to get the kernel involved.

It's also a good way to make sure that deferred callbacks work.  It's a good
use case for deferred callbacks: before I implemented them, the recursive
relationship between the evbuffer callback and the read callback would
make the unit tests overflow the stack.

svn:r1152
2009-04-10 15:01:31 +00:00
Niels Provos
ce146eb1cb Fix parsing of queries where the encoded queries contained \r, \n or +
svn:r1148
2009-04-10 05:43:45 +00:00
Niels Provos
6dece3e980 revert last commit; git user error
svn:r1147
2009-04-10 05:22:15 +00:00
Niels Provos
f43f1d14c5 initial version of query decoding patch
svn:r1146
2009-04-10 05:18:18 +00:00
Nick Mathewson
747331d164 Add freeze support to evbuffers.
From the documentation:
   Prevent calls that modify an evbuffer from succeeding. A buffer may
   frozen at the front, at the back, or at both the front and the back.

   If the front of a buffer is frozen, operations that drain data from
   the front of the buffer, or that prepend data to the buffer, will
   fail until it is unfrozen.   If the back a buffer is frozen, operations
   that append data from the buffer will fail until it is unfrozen.

We'll use this to ensure correctness on an evbuffer when we're waiting
for an overlapped IO call to finish.

svn:r1143
2009-04-08 03:04:39 +00:00
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
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
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
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
acaf65c359 Make evutil_parse_sockaddr_port give a useful socket-length output.
svn:r1118
2009-02-11 17:23:32 +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
71604d85be Remove some needless includes
svn:r1104
2009-02-10 19:38:25 +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
ea11f8195f Compile http_connection_retry_test, but mark it skipped on win32.
svn:r1099
2009-02-02 22:17:32 +00:00
Nick Mathewson
ea4b8724c0 checkpoint work on big bufferevent refactoring
svn:r1095
2009-02-02 19:22:13 +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
ca37fef951 Change evbuffer callbacks to use tinytest natively and never assert.
svn:r1088
2009-02-01 01:07:22 +00:00
Nick Mathewson
a30c9eb1ac Move evbuffer tests into their own file.
svn:r1087
2009-02-01 01:07:12 +00:00
Nick Mathewson
ff7a5e1272 slightly more coverage for evutil.
svn:r1086
2009-01-31 19:32:20 +00:00
Nick Mathewson
12e8db5b23 Convert evtag test.
svn:r1085
2009-01-31 18:36:47 +00:00
Nick Mathewson
5831d11a42 Move rpc_test to regress_rpc.
svn:r1084
2009-01-31 18:36:37 +00:00
Nick Mathewson
fa6ae16992 Convert RPC suite. There are still some places it can exit(1), but those always run forked, so no big deal.
svn:r1083
2009-01-31 18:36:24 +00:00
Nick Mathewson
d9628ef4ff Add missing initializers
svn:r1082
2009-01-31 18:36:08 +00:00
Nick Mathewson
eac75f91e4 Port DNS tests.
svn:r1081
2009-01-31 07:32:14 +00:00
Nick Mathewson
e6ba208ba3 Tinytest update: mostly just to allow test skipping.
svn:r1080
2009-01-31 07:32:00 +00:00
Nick Mathewson
4ec690d35e Rename a couple of http tests so they all end with _test. This lets us simplify the naming.
svn:r1077
2009-01-31 05:45:16 +00:00
Nick Mathewson
153093ecc3 Port the HTTP unit tests. Most are still legacy (since they use test_ok so much), but at least they no longer exit(1) on failure
svn:r1076
2009-01-30 17:44:13 +00:00
Nick Mathewson
241690b230 Move util tests to regress_util.c
svn:r1075
2009-01-30 17:43:59 +00:00
Nick Mathewson
4e9470b481 Convert test_evutil_strtoll to new framework.
svn:r1074
2009-01-30 17:43:48 +00:00
Nick Mathewson
a8203b3490 Refactor unit tests using my spiffy new "tinytest" framework.
The big win here is that we can get process-level isolation.

This has been tested to work okay on at least Linux and Win32.  Only
the tests in regress.c have been converted wrapped in the new wrapper
functions; the others are still on the old system.

svn:r1073
2009-01-29 23:19:57 +00:00
Nick Mathewson
cc7a53c152 fix signed/unsigned warning in unit tests. can we just use "char*" on all new APIs? this void/unsigned char*/char* business is awful.
svn:r1071
2009-01-29 18:15:36 +00:00
Nick Mathewson
7dd362b158 Have util-internal.h define socklen_t if we need it, and include it appropriately. This fixes win32 compilation.
svn:r1070
2009-01-29 15:09:24 +00:00
Niels Provos
66b2a7ffb7 test evbuffer_add_reference
svn:r1068
2009-01-29 03:20:40 +00:00
Nick Mathewson
b85b710cf5 Update copyright statements to reflect the facts that:
a) this is 2009
b) niels and nick have been comaintainers for a while
c) saying "all rights reserved" when you then go on to explicitly
   disclaim some rights is sheer cargo-cultism.

svn:r1065
2009-01-27 22:34:36 +00:00
Nick Mathewson
8889a77039 Replace all use of config.h with event-config.h.
svn:r1064
2009-01-27 22:30:46 +00:00
Nick Mathewson
9993137cbb Remove all trailing whitespace in all the source files.
svn:r1063
2009-01-27 21:10:31 +00:00
Niels Provos
3065389973 make it so that test_persistent_timeout can call loopexit only once; reported by Alexander Drozdov
svn:r1062
2009-01-27 16:35:28 +00:00
Nick Mathewson
f20902a290 Remove evperiodic_assign and its related parts: its functionality is subsumed by EV_PERSIST timeouts.
svn:r1040
2009-01-22 17:56:15 +00:00
Nick Mathewson
dc1526e0da Fix warnings on compile: make static functions static.
svn:r1037
2009-01-22 17:48:16 +00:00
Niels Provos
fe72c885d9 fix signal processing for non-kqueue backends; when a signal callback delivers a signal; from Alexander Drozdov
svn:r1035
2009-01-22 06:23:14 +00:00
Niels Provos
a077fb8c09 rename sys/signal.h to signal.h; configure m4 macro dir; this assist with compilation on Haiku
svn:r1033
2009-01-22 02:47:35 +00:00
Niels Provos
56ea4687a5 Change the semantics of timeouts in conjunction with EV_PERSIST; timeouts in that case will now repeat until deleted.
svn:r1032
2009-01-22 02:33:38 +00:00