2231 Commits

Author SHA1 Message Date
Nick Mathewson
33124033fd Merge remote-tracking branch 'origin/patches-2.0' 2011-06-14 15:15:43 -04:00
Nick Mathewson
b031adf112 Don't break when building tests from git without python installed 2011-06-14 14:52:53 -04:00
Nick Mathewson
261ba63dba Improve evbuffer_ptr documentation 2011-06-13 17:07:29 -04:00
Nick Mathewson
9ab8ab83cd Tweaks to return types with end-of-buf ptrs 2011-06-13 16:55:55 -04:00
Nir Soffer
7aeb2fd4ca Allow evbuffer_ptr to point to position 0 in an empty evbuffer 2011-06-13 16:48:03 -04:00
Nick Mathewson
e6fe1da9ad Allow evbuffer_ptr_set to yield a point just after the end of the buffer. 2011-06-13 16:48:02 -04:00
Nir Soffer
8e2615421d Add failing test for evbuffer_search_range. 2011-06-13 16:48:02 -04:00
Nick Mathewson
e9d095d4fc Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	test/tinytest.c
2011-06-11 01:41:19 -04:00
Nick Mathewson
812d42e886 Simplify windows commandname logic in tinytest
Instead of using a dup'd pointer, let's use a static array, so we
don't need to free it.  This patch also makes tinytest build on
non-windows again.
2011-06-11 01:39:31 -04:00
Ed Day
57def3460a Fix tinytest invocation from windows shell
Original post:

  This post is in response to a posting last December on a Windows
  regression fork failure ([Libevent-users] Re: Libevent 2.0.10-stable
  is released by Dongsheng Song).  I noticed the question was not
  answered and I recently experienced the same error myself when
  trying to run the Windows regression tests myself.

  I checked the return status from the CreateProcess call and found it
  was "file not found".  This led me to look at the command-line I was
  using which was .\regress in a Visual Studio 2008 command prompt
  window.  Windows could not find the file because it did not have the
  .exe extension on the end.  The code that builds the command should
  be modified to ensure the extension is present.
2011-06-11 01:31:59 -04:00
Nick Mathewson
4df9b43305 Merge remote-tracking branch 'origin/patches-2.0' 2011-06-08 17:38:17 -04:00
Nick Mathewson
3203f88c5f Use the correct printf args when formatting size_t
Based on a patch from Mansour Moufid
2011-06-08 17:37:45 -04:00
Mansour Moufid
446cc7a0a1 Check if the evhttp_new_object' function in http.c' returns NULL. 2011-06-08 16:46:21 -04:00
Nick Mathewson
1fd34ab424 Report kqueue ebadf, epipe, and eperm as EV_READ events
When asked to add one side of a pipe, and the other side has been
closed, kqueue on NetBSD will say EBADF; kqueue on FreeBSD will say
EPIPE, and kqueue on OpenBSD will say EPERM.  So treat all of these
as EV_READ events, to give the user an opportunity to notice that
the pipe is closed.

Diagnosed by Nicholas Marriott and Dale Rahn; based on a patch by
Nicholas Marriott.
2011-06-08 15:34:52 -04:00
Nick Mathewson
5099d858b1 Merge remote-tracking branch 'origin/patches-2.0' 2011-06-08 14:29:36 -04:00
Nick Mathewson
09fe97da3b Replace an assertion for event_base_free(NULL) with a check-and-warn
event_base_free(NULL) means "free the current event base".
Previously, it would assert if there was no 'current' base.  Now it
just warns and returns.

Reported by Gilad Benjamini
2011-06-08 14:24:45 -04:00
Nick Mathewson
89d5e09e4d Add some missing checks for mm_calloc failures
Found by Gilad Benjamini
2011-06-08 14:23:37 -04:00
Nick Mathewson
d19a326087 Remove a needless branch in evbuffer_drain()
Found by Gilad Benjamini; see June 2011 thread "Dead or wrong code".
2011-06-08 13:32:47 -04:00
Nick Mathewson
d927965f22 Fix a bug in the improved EOL_CRLF code
When searching for a CRLF, it would find an LF, then look for a
preceding CR if not at the start of the buffer.  That's fine when
we're starting from the beginning of the buffer, but if we're starting
at (say) byte 100, and we have that byte == LF, we shouldn't check for
a CR at byte 99.
2011-06-06 15:33:27 -04:00
Nick Mathewson
264c7b9600 Merge remote-tracking branch 'origin/patches-2.0' 2011-06-06 15:26:37 -04:00
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
e40bafe796 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	Makefile.am
	WIN32-Code/event2/event-config.h
	configure.in
	test/regress_ssl.c
2011-06-04 21:40:55 -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
8254de765d Fix windows file segment mappings
Instead of mapping enough bytes for each segment, we were failing to
take into account the slop created by rounding the segment position
down to the nearest page.

Should fix bug 3142394 found by Sebastian Hahn.
2011-06-02 17:09:53 -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
7b9d13957f Try to squeeze a little more speed out of EVBUFFER_EOL_CRLF 2011-06-01 14:19:13 -04:00
Nick Mathewson
25fe382981 Merge remote-tracking branch 'github/master' 2011-06-01 14:02:56 -04:00
Nick Mathewson
d70dd22009 Merge pull request #17 from minaguib/master
Improve speed of EVBUFFER_EOL_CRLF
2011-06-01 11:02:48 -07:00
Nick Mathewson
36f745df22 Merge remote-tracking branch 'origin/patches-2.0' 2011-06-01 13:52:27 -04:00
Nick Mathewson
d54d3fc40d cygwin: make it possible to build DLLs
Patch from Brian Koehmstedt
2011-06-01 13:48:02 -04:00
Mina Naguib
5dde0f0424 Roughly 20% speed increase when line-draining a buffer using EVBUFFER_EOL_CRLF 2011-05-31 13:56:56 -04:00
Nick Mathewson
5926d601bb Merge branch '21_evport_improved' 2011-05-30 12:10:26 -04:00
Nick Mathewson
0dca19bb8e Merge remote-tracking branch 'origin/patches-2.0' 2011-05-30 12:09:18 -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
257651a48c Merge remote-tracking branch 'origin/patches-2.0' 2011-05-27 23:33:40 -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
Nick Mathewson
942e22681f Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	evthread_win32.c
	listener.c
2011-05-27 23:19:11 -04:00
Peter Rosin
816115a17e InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403. 2011-05-27 23:14:10 -04:00
Nick Mathewson
94b8e676f3 Allow base-notification functions to exist without setting an fd
The kqueue and evport backends can make good use of this.
2011-05-27 22:54:16 -04:00
Nick Mathewson
e903db3362 Reenable main/many_events_slow_add for evport in 2.1
The various evport fixes should let it actually work again
2011-05-27 15:31:40 -04:00
Nick Mathewson
c04d927637 evport: Remove artificial low limit on max events per getn call
Previously, evport could only handle up to 8 events per time through
the loop.  This would impose an artificially high number of syscalls
on us to retrieve a large number of events.

This code allows the EVLOOP_* flags to work more similarly to how
they do on other platforms (up to 4096 events per syscall).  Dispite
dire warning (from 2006), doing this won't impose a big incremental
RAM penalty: if you have 4096 events firing at once, you necessarily
have a proportional number of events pending, and their associated
data structures are already costing a good bit of RAM.

This patch makes the main/many_events_slow_add test pass again.
2011-05-27 15:10:46 -04:00
Nick Mathewson
849a5cffa8 evport: don't scan more events in ed_pending than needed 2011-05-27 15:10:45 -04:00
Nick Mathewson
276ec0ef42 evport: Use portev_user to remember fdinfo struct 2011-05-27 15:10:45 -04:00