2100 Commits

Author SHA1 Message Date
Nick Mathewson
4461f1a096 Fix incorrect results from evbuffer_search_eol(EOL_LF)
Our evbuffer_strchr() function [which was only used for
search_eol(EOL_LF) could give incorrect results if it found its answer
in the first chunk but didn't start searching from the front of the
chunk.

Also, this patch adds unit tests for evbuffer_search_eol, particularly
in those cases that evbuffer_readln() tests didn't exercise.
2011-06-06 15:11:28 -04:00
Nick Mathewson
60c1426f2c Bump version to 2.0.12-stable-dev 2011-06-04 21:36:34 -04:00
Nick Mathewson
281ab5c5f3 Merge branch 'patches-2.0' of ssh://levent.git.sourceforge.net/gitroot/levent/libevent into patches-2.0 2011-06-04 21:12:53 -04:00
Nick Mathewson
452a8342f5 tweak date on changelog 2011-06-04 21:11:09 -04:00
Nick Mathewson
be5e857584 Merge branch 'patches-2.0' of ssh://levent.git.sourceforge.net/gitroot/levent/libevent into patches-2.0 2011-06-04 10:34:14 -04:00
Nick Mathewson
c355583750 Changelog and new credits for 2.0.12-stable release-2.0.12-stable 2011-06-03 17:08:30 -04:00
Nick Mathewson
7283facdb9 Bump version to 2.0.12-stable. Not release just yet 2011-06-03 17:08:14 -04:00
Nick Mathewson
bdfb8330df Fix regress_ssl.c build on openbsd 2011-06-03 17:06:17 -04:00
Nick Mathewson
27ce38b618 Avoid a segfault when all methods are disabled or broken 2011-06-01 17:28:21 -04:00
Nick Mathewson
d54d3fc40d cygwin: make it possible to build DLLs
Patch from Brian Koehmstedt
2011-06-01 13:48:02 -04:00
Nick Mathewson
87c0dff6aa Merge branch '20_select_nfds' into patches-2.0 2011-05-30 12:06:36 -04:00
Nick Mathewson
d90149d4b6 Fix a fencepost bug in the select backend
This bug would sometimes lead us to looking one bit off the end of
the fdset arrays, and trying to activate a (nonexistent) event if
that bit was set.

Found by Harlann Stenn.  Fixes a test failure on OpenSolaris.
2011-05-30 11:53:19 -04:00
Nick Mathewson
f47c15e7ba Make the new http_connect_fail_test use a multicast addr, not broadcast
Turns out that FreeBSD does _not_ give a ENETUNREACH error when
told to make a TCP socket to 255.255.255.255, but it is quite happy
to do so for 239.10.20.30.  So that's what we'll do.

Found by Robert Ransom and Dave Hart.
2011-05-27 23:30:06 -04:00
Peter Rosin
816115a17e InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403. 2011-05-27 23:14:10 -04:00
Nick Mathewson
203ba2742f Fix a couple of signed/unsigned warnings in http.c 2011-05-27 15:08:25 -04:00
Nick Mathewson
c11c6fcd82 Disable main/many_events_slow_add with evport backend
In 2.0 and earlier, evport only reports up to 8 events at a time, which
confuses this test badly.
2011-05-27 14:58:21 -04:00
Nick Mathewson
dbb3c65288 Fix compilation. 2011-05-26 17:43:17 -04:00
Nick Mathewson
f0c9b51cc7 Merge branch 'intcmp_overflow_fixes' into patches-2.0 2011-05-26 17:34:15 -04:00
Mark Ellzey
1814ae9677 updated EV_S(s)IZE definitions 2011-05-26 17:33:18 -04:00
Mark Ellzey
84560fc4dc Added overflow checks in evhttp_read_body and evhttp_get_body 2011-05-26 17:33:18 -04:00
Mark Ellzey
a27927229f Added several checks for under/overflow conditions in evhttp_handle_chunked_read 2011-05-26 17:33:18 -04:00
Sebastian Hahn
d1b2d11bb5 Always use evutil_snprintf, even if OS provides it
In test/tinytest_local.h we can't redefine snprintf if the OS has it
defined already.
2011-05-26 02:05:54 +02:00
Peter Rosin
0de87fe69c Use evutil_gettimeofday instead of relying on the system gettimeofday. 2011-05-25 19:44:06 -04:00
Peter Rosin
3d768dc967 Fix winsock2.h #include issues with MSVC
Define WIN32_LEAN_AND_MEAN, so that windows.h does not bring in
winsock.h which in turn makes it impossible to #include <winsock2.h>
(at least with MSVC)
2011-05-25 19:44:06 -04:00
Peter Rosin
8fa030c032 Make sure TINYTEST_LOCAL is defined when building tinytest.c 2011-05-25 19:44:06 -04:00
Peter Rosin
fe93022a66 unistd.h and sys/time.h might not exist. 2011-05-25 19:44:06 -04:00
Peter Rosin
70be7d17e4 MSVC does not provide S_ISDIR, so provide it manually. 2011-05-25 19:44:06 -04:00
Peter Rosin
f3c7a4c165 Bring in the compile script from automake, if needed. 2011-05-25 19:44:06 -04:00
Peter Rosin
07c41bead2 Make the tests build when OpenSSL is not available.
Don't #define HAVE_OPENSSL (to zero) when OpenSSL is not available.
Code written as #ifdef HAVE_OPENSSL do not expect that.
2011-05-25 19:44:06 -04:00
Peter Rosin
86090ee198 Link with -lshell32 and -ladvapi32 on Win32.
SHGetSpecialFolderPath is in Shell32.dll and the RegOpenKey (et al) and
CryptGenRandom (et al) functions are in -ladvapi32.dll. MinGW is "nice"
and brings those in automatically, but specify them explicitly for
other tool chains.
2011-05-25 19:44:06 -04:00
Nick Mathewson
06a714ffe4 Fix new warnings from GCC 4.6 2011-05-25 16:52:03 -04:00
Mansour Moufid
06c51cdf93 Prevent size_t overflow in evhttp_htmlescape.
Modified the `html_replace' function so that it returns the length of
the replacement string instead of the string itself. This is used to
easily check for overflows of the `new_size' variable in the first for
loop of the `evhttp_htmlescape' function, and thus potential out of
bounds writes in the second for loop (if an overflow occurs in
new_size, then new_size < old_size). Also check that new_size + 1
doesn't overflow in mm_malloc(new_size + 1).

Removed the `scratch_space' variable from the `evhttp_htmlescape'
function since it wasn't actually used; also removed the `buf'
variable from the `evhttp_htmlescape' function since it was only used
by `scratch_space'.
2011-05-23 18:01:24 -04:00
Nick Mathewson
74760f1864 Fix a bug that prevented us from configuring IPv6 nameservers. 2011-05-23 17:45:50 -04:00
Kevin Ko
57ddda7845 Test case for 0848814ac49616
"I'm not sure if you'll like my use of the limited broadcast address
  for simulating an ENETUNREACH error with a TCP connection, but it's
  the best that I could think of.  Basically, we want to trigger a
  non-EINPROGRESS error in evutil_socket_connect() immediately at the
  connect() in order to bring about the assertion in the
  evhttp_connection_fail() error handling code."
2011-05-23 01:40:05 -04:00
Kevin Ko
0848814ac4 Fix failing assertion introducd in commit 0d6622e
Patch in question:
 - Fix the case when failed evhttp_make_request() leaved request in the queue.
 - http://levent.git.sourceforge.net/git/gitweb.cgi?p=levent/libevent;a=commit;h=0d6622e

The above patch introduces a failing assertion in
evhttp_connection_fail().  This happens because the patch defers the
assignment of the outstanding request to the evcon->requests list,
while evhttp_connection_fail() assumes that the request lies in the
list.

One scenario in which this can happen is when the request list is
empty and a connection is made to an unreachable host.  The assertion
will then fail after bufferevent_socket_connect() errors out (with
ENETUNREACH in my case).
2011-05-20 23:23:44 -04:00
Dave Hart
09d39a120d Fix compilation with GCC 2, which had no __builtin_expect 2011-05-20 14:18:08 -04:00
Sebastian Hahn
5786b91e2e Fix a compile warning with zlib 1.2.4 and 1.2.5
I took this fix from Tor (commit 1a52e39c22d5, author Nick Mathewson,
Copyright (c) 2007-2011, The Tor Project, Inc.) and adapted it slightly
for libevent.
2011-05-06 10:58:06 -04:00
Sebastian Hahn
66193853fd Correctly detect openssl on windows 2011-05-06 10:58:06 -04:00
Sebastian Hahn
ceb03b90c4 Move the win32 detection in configure.in 2011-05-06 02:06:36 +02:00
Sebastian Hahn
292092eb29 Use OPENSSL_LIBS in Makefile.am 2011-05-06 02:06:32 +02:00
Peter Rosin
7b819f2d97 Libtool brings in the dependencies of libevent_openssl.la automatically 2011-05-04 16:18:51 -04:00
Peter Rosin
274dd0369a libssl depends on libcrypto, not the other way around. 2011-05-04 16:18:46 -04:00
Nick Mathewson
d11e9e0f71 Oops; that new unit test breaks for epoll. Fix it. 2011-05-03 14:22:48 -04:00
Nick Mathewson
28317a087e Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors
Apparently, kevent fails gracefully if there is not enough space in its
output events array to report every _event_... but it just dies and returns
-1 if there is not enough space to report every _error_.

There are a couple of possible fixes here.  One would to handle -1
returns from kevent better by re-growing the array and retrying... but
that seems a little error prone.  Instead, I'm just going to say that
the events array must be large enough to handle all the errors.

This patch also adds a unit test designed to make sure that our
many-events-out code works even if not all the events are added at
once.
2011-05-03 13:54:57 -04:00
Nick Mathewson
9556a7d1f6 Add missing words to EVLOOP_NONBLOCK documentation 2011-05-02 23:22:09 -04:00
Nick Mathewson
e7529fa45b Bump version to 2.0.11-stable-dev 2011-04-27 21:28:11 -04:00
Nick Mathewson
d4d55196bd Increment version number to 2.0.11-stable release-2.0.11-stable 2011-04-27 20:25:57 -04:00
Nick Mathewson
8255fda708 Add more people to the acknowledgments 2011-04-27 20:15:20 -04:00
Nick Mathewson
d30466fc26 Changelog for 2.0.11-stable 2011-04-27 20:03:46 -04:00
Nick Mathewson
e49e64e774 Fix clang warning when resetting connection
This was a regression on 2.0.10-stable: clang was warning about
values that were unused (because event_debug wasn't using them unless
USE_DEBUG was defined).  Found by Sebastian Hahn.
2011-04-26 23:42:01 -04:00