787 Commits

Author SHA1 Message Date
Nick Mathewson
5c8a59e886 Merge remote branches 'github/20_evdns_cancel_segfault_v2', 'github/20_http_close_detect', 'github/20_http_versions', 'github/20_more_http_methods', 'github/20_shutdown_iocp_listener' and 'github/20_win64_fixes' 2010-11-09 10:19:05 -05:00
Nick Mathewson
3db6bc0079 Remove some debugging puts() calls from allow_methods test 2010-11-09 10:03:00 -05:00
Nick Mathewson
75e3320efd Units test for unexpected evhttp methods. 2010-11-04 12:41:13 -04:00
Christopher Davis
34b84b9727 Fix more wn64 warnings. 2010-11-03 23:30:29 -04:00
Nick Mathewson
985430aed1 Remove need for http_compat.h in http tests 2010-11-03 15:17:57 -04:00
Nick Mathewson
0b137f452e Stop accessing http request struct directly from in the unit tests. 2010-11-03 15:14:29 -04:00
Nick Mathewson
c91622d18c Stop using event_compat.h in regress_http 2010-11-03 15:04:44 -04:00
Nick Mathewson
9bb8239375 Convert the rest of the http tests to be non-legacy unit tests. 2010-11-03 15:00:08 -04:00
Nick Mathewson
353402a87a Rename the confusing "base" static variable in regress_http.c 2010-11-03 14:13:20 -04:00
Nick Mathewson
8505a7449c Start porting http tests to not use legacy interfaces 2010-11-03 14:11:45 -04:00
Nick Mathewson
7484df61c9 Fix even more win64 warnings 2010-11-01 13:43:43 -04:00
Christopher Davis
f8064762ae Increase the skew tolerance to 2 seconds in thread/deferred_cb_skew
This is to make the test not fail on Sebastian Hahn's Win7 box.
2010-10-28 14:11:33 -04:00
Dimitre Piskyulev
f817bfa4d3 Fix some ints to evutil_socket_t; make tests pass on win64. 2010-10-27 17:32:06 -04:00
Nick Mathewson
5d389dc0f0 Fix some uses of int for socket in regress 2010-10-26 22:27:57 -04:00
Nick Mathewson
c281aba30e Fix a nasty bug related to use of dup() with epoll on Linux
Current versions of the Linux kernel don't seem to remove the struct
epitem for a given (file,fd) combo when the fd is closed unless the
file itself is also completely closed.  This means that if you do:
   fd = dup(fd_orig);
   add(fd);
   close(fd);
   dup2(fd_orig, fd);
   add(fd);
you will get an EEXIST when you should have gotten a success.  This
could cause warnings and dropped events when using dup and epoll.

The solution is pretty simple: when we get an EEXIST from
EPOLL_CTL_ADD, we retry with EPOLL_CTL_MOD.

Unit test included to demonstrate the bug.

Found due to the patient efforts of Gilad Benjamini; diagnosed with
help from Nicholas Marriott.
2010-10-24 11:38:29 -04:00
Nick Mathewson
bf11e7ddf7 Merge branch 'http_uri_parse' 2010-10-21 15:33:13 -04:00
Nick Mathewson
bc98f5e6ba Unit tests for evhttp_uri_set* 2010-10-21 14:53:21 -04:00
Nick Mathewson
45f6869c75 Make evhttp_uri non-public, and give it accessor functions. 2010-10-21 14:52:52 -04:00
Nick Mathewson
d9ffa899fa Update the HTTP regression tests to use Libevent2 apis for non-http stuff 2010-10-21 13:04:04 -04:00
Nick Mathewson
1f507d7541 Stop using Libevent-1 headers in regress_http 2010-10-21 12:27:16 -04:00
Nick Mathewson
cd00079b22 Add evhttp_connection_get_base() to get the event_base from an http connection
Based on a patch by Mark Ellzey from 27 July 2010.

Closes ticket 3052406
2010-10-21 12:19:28 -04:00
Nick Mathewson
a5a76e689c Add a huge pile of tests for the new URI functions, and make them pass. 2010-10-19 12:35:50 -04:00
Nick Mathewson
ad923a11f1 Improvements to tinytest_macros.h
First, handle cases where we have %s in a tt_want or tt_assert.

Second, add tt_want_*_op that do a tt_*_op test, but do not exit the
test on failure.

We should push these upstream to tinytest some time.
2010-10-19 12:33:50 -04:00
Nick Mathewson
eaa5f1d9ed Revise evhttp_uri_parse implementation to handle more of RFC3986 2010-10-19 11:26:59 -04:00
Pavel Plesov
86dd720a66 Introduce absolute URI parsing helpers.
See evhttp_uri_parse(), evhttp_uri_free() and evhttp_uri_join() for details.
2010-10-18 14:30:29 -04:00
Nick Mathewson
f13e449b53 Merge branch 'http_parse' 2010-10-18 14:20:06 -04:00
Nick Mathewson
e5870690fc Modernize header usage in bench_http.c 2010-10-18 13:53:31 -04:00
Nick Mathewson
4ebf9509f7 Fixes for MSVC compilation 2010-10-14 14:40:40 -04:00
Nick Mathewson
e06f514d4e Fix signed/unsigned warnings on win32 2010-10-14 13:51:24 -04:00
Nick Mathewson
e5c214a423 Fix -Wsigned-compare warnings in test/* 2010-10-14 13:16:41 -04:00
Nick Mathewson
02f6259fc3 New unit test for ssl bufferevents starting with connected SSLs. 2010-10-14 12:17:28 -04:00
Nick Mathewson
34331e456d The corrected bufferevent filter semantics let us fix our openssl tests 2010-10-14 10:55:04 -04:00
Nick Mathewson
a8148cedcd New evhttp_uri(encode|decode) functions to handle + and NUL characters right
The old evhttp_decode_uri() function would act as tough it was doing
an (illegal, undefined) decode operation on a whole URL at once, and
treat + characters following a ? as different from + characters
preceding one.  But that's not useful: If you are decoding a URI
before splitting off query parameters, you are begging to fail as soon
as somebody gives you a value with an encoded & in it.

The new evhttp_uridecode() function takes an argument that says
whether to decode + signs.  Both uridecode and uriencode also now
support encoding or decoding to strings with internal 0-valued
characters.
2010-10-08 23:58:00 -04:00
Christopher Davis
62b429afa8 Make iocp/listener/error work; don't accept again if lev is disabled. 2010-10-07 18:11:38 -04:00
Nick Mathewson
127d4f2195 Add a LEV_OPT_THREADSAFE option for threadsafe evconnlisteners 2010-10-07 18:11:19 -04:00
Nick Mathewson
b1756d019d Let evhttp_parse_query return -1 on failure
We already detected certain malformed queries, but we responded by
aborting the query-parsing process half-way through without telling
the user.  Now, if query-parsing fails, no headers are returned, and
evhttp_parse_query returns -1.
2010-10-06 12:30:17 -04:00
Nick Mathewson
5b7a370636 Fix warnings on mingw with gcc 4.5 2010-10-05 14:29:48 -04:00
Nick Mathewson
d49b5e3326 Do not search outside of the system directory for windows DLLs
Hardens against some attacks.
2010-09-27 15:45:34 -04:00
Nick Mathewson
045eef4cde Unit tests for listener error callbacks 2010-09-23 14:23:45 -04:00
Nick Mathewson
4858b7949c Remove the now-useless evsig_caught and evsig_process 2010-09-15 01:54:51 -04:00
Nick Mathewson
720bd933c8 Warn when using the error-prone EV_SIGNAL interface in an error-prone way. Also, fix a couple of race conditions in signal.c
When using the signal.c signal backend, Libevent currently only allows
one event_base to actually receive signals at a time.  (This has been
the behavior since at least 1.4 and probably much earlier.)  Now, we
detect and warn if you're likely to be racing about which signal goes
to which thread.

We also add a lock to control modifications of the evsig_base field,
to avoid race conditions like those found by Jason Toffaletti.

Also, more comments.  Comments are good.
2010-09-15 01:12:01 -04:00
Nick Mathewson
f0bd83ea88 Bump to the latest version of tinytest
This lets us do without libevent-specific code in tinytest.c, and
lets us add a feature to skip individual tests from the command
line.
2010-09-09 16:13:09 -04:00
Nick Mathewson
a5ce9ad4af Make SSL tests cover enabling/disabling EV_READ.
I want my 80% coverage.
2010-09-09 16:01:42 -04:00
Nick Mathewson
2756a10cd9 Add a missing time.h include to test/regress_thread.c 2010-09-09 13:43:31 -04:00
Nick Mathewson
fb36f9a7e5 Fix an uninitialized-variable warning on windows 2010-09-09 13:00:54 -04:00
Christopher Davis
3ec65d6984 Fix a few Windows compile warnings. 2010-09-08 19:55:13 -07:00
Nick Mathewson
25b6a74be6 Merge branch 'tests' 2010-09-08 14:53:57 -04:00
Nick Mathewson
de412948a1 Add a missing header for regress_thread.c 2010-09-08 14:52:24 -04:00
Sebastian Hahn
911e0db8f0 Fix a compile warning in regress_thread.c 2010-09-08 20:29:39 +02:00
Nick Mathewson
3658b1696d Merge remote branch 'chrisd/iocp-fixes4'
Conflicts:
	test/regress_thread.c
2010-09-08 14:12:12 -04:00