2530 Commits

Author SHA1 Message Date
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
Nick Mathewson
ba4d66961e Increment version to 2.0.16-stable-dev 2011-11-18 15:34:37 -05:00
Nick Mathewson
5de3fa3208 Increment version to 2.0.16-stable release-2.0.16-stable 2011-11-18 15:27:06 -05:00
Nick Mathewson
044c41de84 Merge remote-tracking branch 'origin/patches-2.0' 2011-11-18 15:16:11 -05:00
Nick Mathewson
31c99bd28f Revise 2.0.16-stable changelog 2011-11-18 15:14:50 -05:00
Nick Mathewson
9ee9e943a8 Merge remote-tracking branch 'origin/patches-2.0' 2011-11-18 14:23:13 -05:00
Nick Mathewson
ebf82199df add comment to new consider_reading code 2011-11-17 17:42:45 -05:00
Mark Ellzey
2aa036fa04 Avoid spinning on OpenSSL reads
Previously, if some sender were generating data to read on an
OpenSSL connection as fast as we could process it, we could easily
wind up looping on an openssl do_read operation without ever
considering other sockets.

The difference between this and the original method in
consider_reading() is that it only loops for a single completed
*frame* instead of looping until fd is drained or an error condition
was triggered.

{Patch split out by nickm}
2011-11-17 11:59:41 -05:00
Nick Mathewson
96c562fa49 Move SSL rate-limit enforcement into bytes_to_read() 2011-11-17 11:54:07 -05:00
Mark Ellzey
a186e73200 Refactor amount-to-read calculations in buffervent_ssl consider_reading()
Split up consider_reading()'s conditional checks into another function
can_read() for simplicity sake.

{Split into a separate patch by nickm}
2011-11-17 11:45:49 -05:00