233 Commits

Author SHA1 Message Date
Nick Mathewson
641d0d88dc Changelog for 1.4.15-stable. 2014-11-30 19:33:03 -05: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
William Ahern
5713d5dd33 Valgrind fix: Clear struct kevent before checking for OSX bug.
William's original commit message:

   Valgrind complains on startup because kq_init passes to kevent only
   a partially initialized structure. The code doesn't expect kevent
   to look at .fflags, .udata, or .data, I suppose, because it merely
   tickles the kernel looking for an error response. But perhaps
   that's unwarranted chuminess (notwithstanding that it's checking
   for an OS X bug), and needless noise nonetheless.
2009-11-29 10:23:39 -05:00
Nick Mathewson
c545485407 Make the evbuffer_readln backport follow the current API 2009-11-23 13:22:15 -05:00
Nicholas Marriott
b04cc60f13 Backport evbuffer_readln().
This is necessary because it is not actually possible to use
evbuffer_readline() safely: it will treat "A\r\n" as 'A' EOL if it
reads it all at once, and as 'A' EOL EOL if there is a delay between
reading the \r and the \n.

Nicholas Marriott's comments on this patch:

   Gilles is too busy so I've had a go at this, please see the diff
   below.  Rather than try to backport directly from 2.0 where the
   evbuffer code is quite different, I've backported the _readln
   function from when it was initially added in buffer.c r550. I can't
   see any relevant bug fixes after this point so the function is
   pretty much just copied in directly from that revision.
2009-11-23 12:55:50 -05:00
Nick Mathewson
d014edb2c0 Add a .gitignore file for the 1.4 branch. 2009-11-20 12:20:49 -05:00
Niels Provos
06d26fc843 call it 1.4.13-stable
svn:r1544
2009-11-18 04:11:22 +00:00
Nick Mathewson
f76b599d28 Fix 1.4 compilation on msvc, and add a couple of minimal (not-quite-right) nmakefiles.
svn:r1534
release-1.4.13-stable
2009-11-16 19:21:25 +00:00
Nick Mathewson
25da0672f7 Partial backport of event_rpcgen portability fixes.
svn:r1533
2009-11-16 18:46:10 +00:00
Nick Mathewson
3487906f9d Add a missing include to make win32 compile.
svn:r1532
2009-11-16 18:04:13 +00:00
Nick Mathewson
eb1fa9f78e When running set[ug]id, don't check the environment.
Idea from OpenBSD, but made a bit more generic to handle uncivilized lands
that do not define issetugid.

svn:r1529
2009-11-15 18:59:55 +00:00
Nick Mathewson
b4183c732e Stop too many bytes for activequeues.
We were saying calloc(N,N*sizeof(struct event_list*)) when we should have
been saying calloc(N,sizeof(struct event_list*)).  This wasted N*(N-1) words
of memory, where N was the number of priorities.  This wouldn't be a big deal
for any sane number of priorities, but it's a bug nonetheless.

svn:r1526
2009-11-09 19:55:40 +00:00
Nick Mathewson
e32d055b5e Backport GNU/kfreebsd kqueue fix
svn:r1515
2009-11-06 21:23:52 +00:00
Nick Mathewson
6ce14fd01c Rename compat/sys/_time.h to compat/sys/_libevent_time.h
On some systems (notably HPUX), there is already a
/usr/include/sys/_time.h, which our sys/_time.h shadows.  Found and
diagnosed by Kathryn Hogg.

This is a quick fix for 1.4 only; for 2.0, I want to eliminate
compat/sys/_time.h entirely, and have util-internal subsume it.



svn:r1493
2009-11-03 19:15:27 +00:00
Nick Mathewson
756c4cd394 Declare struct timezone in evutil.h so that borken mingw versions do not complain
svn:r1442
2009-10-12 21:09:14 +00:00
Niels Provos
c5a0f56c9a from trunk: Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec
svn:r1437
2009-09-24 22:21:09 +00:00
Nick Mathewson
03a9da175a Fix compilation on Android: define fd_mask when it's missing.
svn:r1434
2009-09-23 23:50:43 +00:00
Nick Mathewson
072ae5887e Remove unused event_gotsig code from 1.4 to appease some automated code checkers
svn:r1433
2009-09-23 22:19:00 +00:00