1071 Commits

Author SHA1 Message Date
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
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
52eb495130 Build with the -fno-strict-aliasing flag on GCC.
You do not want to know about the 2 hours I just spent tracking down
an evdns bug that only affected me on some platforms to the way we
were using sockaddr* and sockaddr_in*.  Suffice it to say that I do
not think this is the only C99-aliasing-dubiousness in our code, nor
that I am smart enough to keep my code correct with the GCC's strict
aliasing optimizations in place.

svn:r1079
2009-01-31 07:31:47 +00:00
Nick Mathewson
2546ea665e Do not attempt to pass a va_args to regular snprintf. Hilarity will ensue. Fortunately, 1.4 does not have this bug.
svn:r1078
2009-01-31 05:45:26 +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
39c8dbe073 Make ht-internal.h get distributed.
svn:r1072
2009-01-29 20:07:59 +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
a0cae310d0 make it so that evbuffer_add_file where we read the complete contents of the file can fail without side effects
svn:r1069
2009-01-29 03:22:47 +00:00
Niels Provos
66b2a7ffb7 test evbuffer_add_reference
svn:r1068
2009-01-29 03:20:40 +00:00
Nick Mathewson
f13bede758 Fix an unlikely degenerate case of evutil_vsnprintf
svn:r1067
2009-01-28 20:31:19 +00:00
Nick Mathewson
e3e696c822 Use size_t for name length in DNS requests. Not that it matters much.
svn:r1066
2009-01-28 20:24:12 +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