2439 Commits

Author SHA1 Message Date
Nick Mathewson
67a1763bc4 Make regression tests run over 3x faster.
This was mainly a matter of reducing timeouts and delays, paying
special attention to every test that took longer than a second to
finish.

We could do better here; IMO anything over .7 sec is probably too
long, but it's a big win as it is.

Remember, interactive computing is a big win over batch processing:
anything that makes you get up and walk away from the terminal might
as well be making you carry your punch cards over to the mainframe.
2012-01-24 14:48:04 -05:00
Nick Mathewson
350a3c400f New evhttp function to adjust initial retry timeout 2012-01-24 14:48:02 -05:00
Nick Mathewson
ab14f7c140 Reduce the timeout in the main/fork test.
There was no reason for it to be so long, except for the lack of a usleep
2012-01-24 14:47:30 -05:00
Nick Mathewson
f25d9d32b1 Add an (internal) usleep function for use by unit tests 2012-01-24 11:42:26 -05:00
Nick Mathewson
18653fcae7 Merge remote-tracking branch 'origin/patches-2.0' 2012-01-24 11:17:06 -05:00
Nick Mathewson
5408ff3b89 Oops:remove an accidentally committed "sleep(1)" in a unit test 2012-01-24 11:16:26 -05:00
Nick Mathewson
10996a1a0b Merge remote-tracking branch 'origin/patches-2.0' 2012-01-24 11:04:56 -05:00
Nick Mathewson
dab91877bc Workaround in the unit tests for an apparent epoll bug in Linux 3.2 2012-01-24 11:04:19 -05:00
Nick Mathewson
fe0afabb59 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	event.c

Edits required in:
        evmap.c
2012-01-24 10:29:31 -05:00
Nick Mathewson
3f18ad1b5f Fix a fd leak in event_reinit()
We were supposed to be closing the ev_signal_pair sockets.
2012-01-23 18:15:44 -05:00
Nick Mathewson
6e41cdc16b Fix a list corruption bug when using event_reinit() with signals present
While re-adding all the events, event_reinit() could add a signal
event, which could then cause evsig_add() to add the
base->sig.ev_signal event.  Later on its merry path through
base->eventqueue, event_reinit() would find that same event and give
it to event_io_add a second time.  This would make the ev_io_next
list for that fd become circular.  Ouch!
2012-01-23 17:59:16 -05:00
Nick Mathewson
3312b02036 Check event_base correctness at end of each unit test 2012-01-23 17:43:35 -05:00
Nick Mathewson
40a3c52d05 Fix compilation of windows evutil_check_ifaddrs 2012-01-22 22:27:16 -05:00
Nick Mathewson
27737d55ae Add function to check referential integrity of an event_base 2012-01-21 12:55:15 -05:00
Nick Mathewson
5683e2b1a8 Merge remote-tracking branch 'github/linked_list'
Conflicts:
	include/event2/event_struct.h
2012-01-20 16:31:20 -05:00
Nick Mathewson
677f23cc22 Merge remote-tracking branch 'origin/patches-2.0' 2012-01-20 11:40:39 -05:00
Catalin Patulea
790f6b3b10 Force strict validation of HTTP version in response.
This sometimes accepted invalid versions like 'ICY' (n = 0, major = undefined, sometimes > 1).
2012-01-20 11:37:38 -05:00
Nick Mathewson
a86a0c0463 Merge remote-tracking branch 'origin/patches-2.0' 2012-01-16 14:47:05 -05:00
Nick Mathewson
7206e8cdd4 Suppress a gcc warning from ignoring fwrite return in http-sample.c
Found by Steve Snyder
2012-01-16 14:45:31 -05:00
Nick Mathewson
26e85fcce4 Merge remote-tracking branch 'origin/patches-2.0' 2012-01-09 16:54:19 -05:00
Nick Mathewson
cba48c7d46 Fix a race condition in the dns/bufferevent_connect_hostname test.
As originally written, the test would only pass if the accept()
callbacks for the evconnlistener were all invoked before the last of
the CONNECTED/ERROR callbacks for the connecting/resolving bufferevent
had its call to event_base_loopexit() complete.  But this was only
accidentally true in 2.0, and might not be true at all in 2.1 where
we schedule event_base_once() callbacks more aggressively.

Found by Sebastian Hahn.
2012-01-09 16:44:53 -05:00
Nick Mathewson
d5a3fe5f3e Merge remote-tracking branch 'origin/patches-2.0' 2012-01-09 12:00:04 -05:00
Nick Mathewson
ecfc720a4f Make evconnlistener work around bug in older Linux when getting nmapped
Older Linuxes sometimes respond to some nmap probes by having accept()
return a success but with socklen 0.  That can lead to confusing behavior
when you go to process the sockaddr.
2012-01-09 11:49:41 -05:00
Nick Mathewson
f032516718 Remove bogus casts of socket to int before calling ev_callback
This should make 64-bit windows act better.

Found by Mark Heily.
2012-01-09 11:33:38 -05:00
Nick Mathewson
0586c25ec8 Merge remote-tracking branch 'origin/patches-2.0' 2011-12-14 16:28:18 -05:00
Arno Bakker
da70fa705b Backport evhttp_connection_get_bufferevent to Libevent 2.0
Backport by Arno Bakker; original implementation in 8d3a8500f4
2011-12-14 16:17:19 -05:00
Nick Mathewson
cac02fadc2 Merge remote-tracking branch 'origin/patches-2.0' 2011-12-08 14:38:04 -05:00
Nick Mathewson
7bbf6ca771 Slightly clarify evbuffer_peek documentation 2011-12-08 14:36:35 -05:00
Zack Weinberg
c986f2321d Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0)
(Patch altered by nickm to not affect the behavior of
evbuffer_peek(buf,-1,NULL,vec,n_vec).)
2011-12-08 14:31:09 -05:00
Nick Mathewson
e0f0dbf99f Remove some accidentally-committed debugging code 2011-12-08 14:11:30 -05:00
Nick Mathewson
5c7675cc5a whitespace fixes 2011-12-08 14:05:47 -05:00
Nick Mathewson
de5428e7d5 Merge remote-tracking branch 'fancycode/buffer_references'
Conflicts:
	buffer.c
2011-12-08 14:04:04 -05:00
Nick Mathewson
d430602863 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	configure.in
2011-12-08 11:43:04 -05:00
Mike Frysinger
358c745e54 check for sysctl before we use it
Not all C libraries under Linux support the sysctl() func.
2011-12-08 11:39:48 -05:00
Nick Mathewson
88a30ad880 Split up extra-long AC_CHECK_FUNCS/HEADERS lines in configure.in 2011-12-07 18:29:06 -05:00
Nick Mathewson
56c6afe26a Merge branch '21_ifaddr' 2011-12-07 18:17:34 -05:00
Nick Mathewson
7085a4568c Use getifaddrs to detect our interfaces if possible
The old scheme involved connected UDP sockets and getsockname(), and is
generally best avoied.
2011-12-07 18:16:32 -05:00
Joachim Bauch
a8e5e2fce4 Changed use of refcounts to make sure referenced chains are freed in all cases. 2011-12-07 21:06:10 +01:00
Nick Mathewson
27e222559a Add evbuffer_copyout_from to copy data from the middle of a buffer
You could previously do this with evbuffer_peek() and some memcpys,
but it was a bit more work than most folks wanted to get into.

Closes sourceforge ticket 3108072
2011-12-07 13:04:35 -05:00
Nick Mathewson
35c5c9558a Bypass event_add when using event_base_once() for a 0-sec timeout
Some people use event_base_once(EV_TIMEOUT) to make a callback get
called "immediately".  But this is pretty roundabout: it uses the
timeout heap to immediately put the event onto the active queue, when
it could just use event_active.  Additionally, it can lead to
surprising re-ordering behavior.

This patch changes event_base_once so it bypasses event_add() and
called event_active() directly on a pure-timeout event with an empty
timeout.
2011-12-07 11:49:52 -05:00
Nick Mathewson
748a0d2794 Merge remote-tracking branch 'origin/patches-2.0' 2011-12-06 13:38:40 -05:00
Colin Watt
19277763b2 Fix a silly compilation error with the sun compiler
Apparently, other compilers were allowing "return free(x)" in a
function returning void.
2011-12-06 13:35:54 -05:00
Nick Mathewson
9ce5053d6e Merge remote-tracking branch 'origin/patches-2.0' 2011-12-06 11:02:12 -05:00
Nick Mathewson
11f36a5f76 Be absolutely sure to clear pncalls before leaving event_signal_closure
I thought we'd fixed the cases where this could come up, but
apparently having an event_base_break() happen while processing
signal events could get us in trouble.

Found by Remi Gacogne.  Sourceforge issue 3451433 .
2011-12-05 15:06:46 -05:00
Nick Mathewson
da45aa74a7 fix windows compilation issues with new file segment code
Found by Linus Nordberg
2011-12-02 01:48:17 -05:00
Nick Mathewson
f3b89dec9e Fix two issues in the allow_dirty_shutdown code.
First, it shouldn't crash when it's passed a non-ssl bufferevent.

Second, it should behave correctly when it gets a true argument
other than 1.
2011-11-24 12:31:50 -05:00
Nick Mathewson
a44cd2b020 Tweak allow_dirty_shutdown documentation 2011-11-24 12:24:38 -05:00
Catalin Patulea
099d27df2b Allow users to set allow_dirty_shutdown 2011-11-24 12:18:30 -05:00
Catalin Patulea
f7eb69ace4 bev_ssl: Be more specific in event callbacks. evhttp in particular gets confused without at least one of BEV_EVENT_{READING|WRITING}. 2011-11-24 12:18:23 -05:00
Nick Mathewson
3596a31d63 Merge remote-tracking branch 'origin/patches-2.0' 2011-11-18 15:35:33 -05:00