249 Commits

Author SHA1 Message Date
Pierce Lopez
46a1375b59 evhttp: fix leak from keep-alive disconnect or read/write timeout
When a keep-alive HTTP/1.1 connection disconnects, or when there's
a read or write timeout (default after 60 seconds), evhttp failed to
free the connection context memory.
2015-01-28 13:37:16 -05:00
Nick Mathewson
2216a9bdba Revert "Defensive programming to prevent (hopefully impossible) stack-stomping"
This reverts commit 2d8cf0b720cdd5f9f292f174a10ff74e62a380ec.

Reverting because this commit caused a use-after-free in callbacks
that call event_del.
2015-01-19 13:34:43 -05:00
Nick Mathewson
6067b1d035 Remove a needless declaration
Spotted by Alexander Bluhm.
2015-01-19 13:30:54 -05:00
Nick Mathewson
3e9aad7221 update changelog release-1.4.15-stable 2015-01-05 09:34:32 -05:00
Nick Mathewson
2ff3be6e16 Merge branch '14_cve_2014_6272_v2' into patches-1.4 2015-01-05 09:34:01 -05:00
Nick Mathewson
4228f76907 Increment version for 1.4.15-stable 2015-01-05 09:07:15 -05:00
Nick Mathewson
76f510e39b Update 1.4 changelog 2015-01-05 08:37:02 -05:00
Nick Mathewson
7b21c4eabf Fix CVE-2014-6272 in Libevent 1.4
For this fix, we need to make sure that passing too-large inputs to
the evbuffer functions can't make us do bad things with the heap.
2015-01-05 08:30:46 -05:00
Nick Mathewson
10d228c9ef Merge remote-tracking branch 'sourceforge/patches-1.4' into patches-1.4 2014-11-30 21:04:43 -05:00
Nick Mathewson
867f3b382e Note the progress for the 14 changelog 2014-11-30 19:38:54 -05:00
Nick Mathewson
641d0d88dc Changelog for 1.4.15-stable. 2014-11-30 19:33:03 -05:00
Nick Mathewson
2d8cf0b720 Defensive programming to prevent (hopefully impossible) stack-stomping 2011-04-21 18:16:26 -04:00
Trond Norbye
353b4ac6c7 Check for POLLERR, POLLHUP and POLLNVAL for Solaris event ports 2011-01-06 12:46:13 -05:00
Nick Mathewson
e50ba5b61b Fix a bug that could allow dns requests with duplicate tx ids
Spotted by Marko Kreen
2010-11-19 12:37:49 -05:00
Nick Mathewson
1d6e30e6f8 Avoid truncating huge values for content-length 2010-11-19 12:35:47 -05:00
Nick Mathewson
7cf794b681 Take generated files out of git; add correct m4 magic for libtool to auto* files 2010-09-03 15:21:09 -04:00
Nick Mathewson
823d9be57f Prefer autoregen -ivf to manual autogen.sh
Suggested by Ralph Castain
2010-09-03 15:13:57 -04:00
VDm
53c47c2eb9 Fix compilation on Visual Studio 2010 2010-08-30 11:08:59 -04:00
Nick Mathewson
f0ff7659f3 Fix an issue with forking and signal socketpairs in select/poll backends
Nicholas Marriott identifies an issue where a signal socketpair
doesn't get recreated if the event backend doesn't set event_reinit.
2010-08-26 15:09:58 -04:00
Marco
95b71d0cd6 Backport doc fix for evhttp_bind_socket. 2010-08-24 12:44:33 -04:00
Nick Mathewson
e0e6958aa0 Avoid deadlock when activating signals.
Fixes bug 3048812.

Based on patch by Nicholas Marriott.
2010-08-19 14:00:06 -04:00
Nick Mathewson
1c25b07ea7 Fix kquue correctness test on x84_64
Apparently, in our configure.in check for a working kqueue, we were
leaving some fields unset that seemed to irritate 64-bit kqueue a lot.

Found by Christopher Layne
2010-08-19 09:38:44 -04:00
Nick Mathewson
44f04a2b85 Replace unused case of FD_CLOSEONEXEC with a proper null statement. 2010-08-19 09:36:33 -04:00
Ralf Schmitt
9985231eb7 set close-on-exec bit for filedescriptors created by dns subsystem 2010-08-18 10:44:05 -04:00
Nick Mathewson
8a5ebd387c Backport and tweak the LICENSE file for 1.4 2010-08-13 12:12:52 -04:00
Nick Mathewson
b3d03822e4 Pass flags to fcntl(F_SETFL) as int, not long
Everybody but Linux documents this as taking an int, and Linux is
very tolerant of getting an int instead.  If it weren't, everybody
doing fcntl(fd,F_SETFL,O_NONBLOCK) would break, since the glibc
headers define O_NONBLOCK as an int literal.
2010-07-13 11:06:08 -04:00
Nick Mathewson
eb8122f26c Increment the version to 1.4.14b; add a changelog for our VERSION_INFO snafu on 1.4.14 release-1.4.14b-stable 2010-06-19 11:56:12 -04:00
Nick Mathewson
fd32d368f1 Set the VERSION_INFO correctly for 1.4.14
I've also added a long comment explaining our history of
VERSION_INFO as relevant for the 1.4.x series.
2010-06-19 11:51:47 -04:00
Nick Mathewson
b3360c1602 Increment Libevent version to 1.4.14-stable release-1.4.14-stable 2010-05-27 01:30:23 -04:00
Nick Mathewson
6224ff8760 Changelog for 1.4.14-stable 2010-05-27 01:11:55 -04:00
Nick Mathewson
6cbea13b03 Define _REENTRANT as needed on Solaris, elsewhere
It turns out that _REENTRANT isn't only needed to make certain
functions visible; we also need it to make pthreads work properly some
places (like Solaris, where forgetting _REENTRANT basically means that
all threads are sharing the same errno).

Unlike in 2.0, we can't use the PTHREAD_CFLAGS variable to see what
flags to use, since we aren't using pthreads in 1.4.  Instead, we just
check the host type explicitly, like acx_pthreads does.
2010-05-10 19:58:17 -04:00
Nick Mathewson
906d573b4c Fix compile warning in http.c 2010-05-10 19:57:13 -04:00
Pierre Phaneuf
29d7b32813 Do not abort HTTP requests missing a reason string.
Some (arguably broken) HTTP servers do not put the reason message in their
status line, which causes evhttp to consider the response invalid.

http://sourceforge.net/tracker/?func=detail&aid=2875077&group_id=50884&atid=461322
2010-04-27 22:25:59 -04:00
Gilad Benjamini
ae6ece02f6 Clean up properly when adding a signal handler fails.
Previously, when a signation() or signal() call failed, we would free
the element we added to sh_old, but not actually clear the pointer.
This would leave a dangling pointer in sh_old that could cause a
crash later.
2010-04-21 01:15:19 -04:00
Niels Provos
cb1a722386 Fix memory leak when setting up priorities; reported by Alexander Drozdov
Backport from Libevent 2.0 commit 1c927b7
2010-04-14 13:15:58 -04:00
Nick Mathewson
245893479a Fix a free(NULL) in min_heap.h
Backport of 6f20492fa27f08
2010-03-26 14:22:47 -04:00
Niels Provos
01ea0c5c28 make evhttp_send() safe against terminated connections, too 2010-02-13 16:42:12 -08:00
Niels Provos
5c8b446eba do not fail while sending on http connections the client closed.
when sending chunked requests via multiple calls to evhttp_send_reply_chunk,
the client may close the connection before the server is done sending. this
used to cause a crash.

we introduce a new function evhttp_request_get_connection() that allows the
server to determine if the request is still associated with a connection.
If it's not, evhttp_request_free() needs to be called explicitly or the user
can call evhttp_send_reply_end() which just frees the request, too.
2010-02-13 16:38:55 -08:00
Nick Mathewson
20d706d044 Distribute nmake makefile for 1.4 2010-02-12 00:02:22 -05:00
Brodie Thiesfield
bce58d61c8 Make Libevent 1.4.12 build on win32 with Unicode enabled.
This patch fixes calls to the win32 api to explicitly call the char* versions
of the functions. This fixes build failures when libevent is built with the
UNICODE define.
2010-02-03 23:28:29 -05:00
Nick Mathewson
bd03d0682c Re-add event_siglcb; some old code _was_ still using it. :(
Such code really needs to migrate to use signal events instead.

This reverts commit 072ae5887e8064da500adbd2d24050bb96fbe75d.
2010-01-14 18:44:35 -05:00
Pavel Plesov
4fd2dd9d83 Do not send an HTTP error when we've already closed or responded.
Previously, we'd issue an HTTP/1.1 400 Bad Request" response on every
connection close, event if sever sent response already.

This patch changes the behavior, so we only issue the response on
close when the connection state is not DISCONNECTED, and so we set
the state to DISCONNECTED when the connection closes.

Includes a regression test; fixes sourceforge bug 2909909.
2010-01-11 18:54:23 -05:00
Nick Mathewson
8771d5b646 Merge branch 'readln-backport' into patches-1.4 2010-01-07 02:25:48 -05:00
Nick Mathewson
35df59e9e1 Correct a debug message in evhttp_parse_request_line
The old message reported that evhttp_decode_uri had failed; in fact,
strdup had failed.

Found by Michael Lenaghan.
2010-01-04 01:01:54 -05:00
Jardel Weyrich
5f2e250753 Adjusted fcntl() retval comparison on evutil_make_socket_nonblocking().
Apparently, a successful return value on F_SETFL is "anything but
-1".
2009-12-29 15:17:46 -05:00
Jardel Weyrich
81c26ba43b Make evutil_make_socket_nonblocking() leave any other flags alone.
Fixes bug 2922121
2009-12-28 16:07:41 -05:00
Nick Mathewson
ac0d213c4a Correct all versions in 1.4 branch 2009-12-18 23:50:42 -05:00
Evan Jones
891765cd8e Update sample/signal-test.c to use newer APIs and not leak. 2009-12-08 17:02:24 -05:00
Nick Mathewson
01f3775b37 Fix memory-leak of signal handler array with kqueue. [backport]
It turns out that kqueue_dealloc wasn't calling evsig_dealloc()
(because it doesn't use the main signal handler logic) so the sh_old
array was leaking.

This patch also introduces a fix in evsig_dealloc() where we set
the sh_old array to NULL when we free it, so that main/fork can pass.
2009-12-08 16:55:46 -05:00
Yasuoka Masahiko
5b10d008e9 Fix a crash when reading badly formatted resolve.conf
Based on patch from Yasuoka Masahiko, backported to 1.4.
2009-12-04 14:08:14 -05:00