2230 Commits

Author SHA1 Message Date
Tomash Brechko
218cf19743 Fix subtle recursion in evhttp_connection_cb_cleanup(). 2011-04-04 14:44:34 -04:00
Tomash Brechko
272823f8b0 Reset outgoing connection when read data in idle state.
Imagine server side is buggy and miscalculates Content-Length: in the
reply.  Data arriving in idle state shouldn't make us crash, instead we
can just reset the connection.
2011-04-04 14:41:45 -04:00
Nick Mathewson
7a91f732be Merge remote branch 'origin/patches-2.0' 2011-03-23 16:34:58 -04:00
Nick Mathewson
c621359122 Add comment to configure.in to explain gc-sections test logic
(Basically, we need access to conftest.err for the test to work properly.)
2011-03-23 16:32:42 -04:00
Dave Hart
6bb23e4bb1 Fix for --gc-sections on NetBSD
This patch fixes http://bugs.ntp.org/1844, works around
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=40401, by
improving the test for support of --gc-sections to run a program which
reads a file using stdio built with --gc-sections, instead of simply
link the binary.  This catches the buggy linker as the garbage
collection removes a tag NetBSD uses to distinguish its own elf
binaries from Linux ones, causing it to treat conftest as a Linux
binary and run it with the wrong syscall table.
2011-03-23 16:23:59 -04:00
Dave Hart
b5a1f9f74b Fix make distcheck & installation of libevent 1 headers
libevent/Makefile.am corrects a typo (thanks to Harlan for spotting it
once we realized make distcheck was broken when building the libevent
tearoff).  The result was the include/ev*.h were not distributed nor
installed whether or not --disable-libevent-install was used.  This
was introduced with the final round (3/3) of
--disable-libevent-install patch from me.
2011-03-23 16:22:24 -04:00
Nick Mathewson
4ab2a89dc7 Merge remote branch 'origin/patches-2.0' 2011-03-12 12:12:35 -05:00
Christophe Fillot
4b8f02f147 Fix incorrect assertions and possible use-after-free in evrpc_free()
Original description:

  The following patch fixes incorrect assertions in evrpc_free():
  evrpc_unregister_rpc() and evrpc_remove_hook() return 0 for success.

  Also, in evrpc_unregister_rpc(), it is better to free RPC structure
  at the end: evrpc_free() uses rpc->uri as "name" parameter when
  calling evrpc_unregister_rpc(), then rpc->uri is freed, but we have
  "registered_uri = evrpc_construct_uri(name)". So at this time "name"
  is invalid.
2011-03-12 12:08:19 -05:00
Nick Mathewson
f28084ddda munge the debug_lock signature before freeing it: it might help us catch use-after-free 2011-03-07 23:18:07 -05:00
Dave Hart
b4a29c0a0f Add a magic number to debug_locks to better catch lock-coding errors.
Original description by Dave Hart:

 [This patch contains] the addition of a signature field to debug_lock
 initialized by the alloc routine and verified by the rest, to catch
 invalid lock pointers sooner. That helped me track down a nasty
 problem I had before adding the time.h include to
 libevent-internal.h, where different .c files had different ideas of
 whether event_base had a tod_tv_cache member depending on which
 included time.h before libevent-internal.h.
2011-03-07 23:08:42 -05:00
Nick Mathewson
2a83ecc849 In the 2.1 branch, let's try out lazy gettimeofday/clock_gettime comparison
For now, we'll only check for gettimeofday jumps once every 5 seconds.
Let's see how that works.

This reverts commit 5209fadfd07af3f3379ac607582c37933b33e044.
2011-03-07 23:01:54 -05:00
Nick Mathewson
4560b31bdf Merge remote branch 'origin/patches-2.0'
Conflicts:
	event-internal.h
2011-03-07 23:00:45 -05:00
Nick Mathewson
5209fadfd0 Disable lazy gettimeofday/clock_gettime comparison for now 2011-03-07 22:59:19 -05:00
Nick Mathewson
9193dc4ecd Merge branch '20_timescale' into patches-2.0 2011-03-07 22:45:10 -05:00
Nick Mathewson
c53895944d Merge remote branch 'origin/patches-2.0' 2011-03-07 21:59:47 -05:00
Nick Mathewson
c8baac9023 Followup for Tomash Brechko's http patch
This patch makes bufferevent_disable_hard() non-public, and
adds a comment about what it's for and why it's used.
2011-03-07 21:58:16 -05:00
Tomash Brechko
5dc566284d Workaround libevent bug
https://sourceforge.net/tracker/index.php?func=detail&aid=3078187&group_id=50884&atid=461324

The problem is that bufferevent_disable() doesn't disable EV_WRITE
when 'connecting' flag is set.  However from evhttp_connection_reset()
we want to disable EV_WRITE for sure (we are closing the socket next).
So we add bufferevent_disable_hard(), which acts like
bufferevent_disable(), but resets 'connecting' flag before the call to
the actual handler.

TODO: bufferevent_disable_hard() shouldn't be public, remove it from
event2/bufferevent.h.
2011-03-07 21:41:45 -05:00
Nick Mathewson
a459ef70ec Have event_base_gettimeofday_cached() always return wall-clock time
Based on code by Dave Hart
2011-03-03 15:48:26 -05:00
Nick Mathewson
74bf57a63e Merge remote-tracking branch 'origin/patches-2.0' 2011-03-03 12:58:06 -05:00
Dave Hart
ab008c7d05 Make --no-libevent-install apply to event1 headers too 2011-03-03 12:57:17 -05:00
Nick Mathewson
83fb674a75 Merge remote branch 'origin/patches-2.0' 2011-02-25 10:42:58 -05:00
Dave Hart
b5ab955531 Make --no-libevent-install apply to headers too 2011-02-25 10:35:12 -05:00
Nick Mathewson
975eacad36 Merge remote branch 'origin/patches-2.0' 2011-02-23 11:25:09 -05:00
Sebastian Hahn
3f79a3a01a Continue AM_CFLAGS to AM_CPPFLAGS correction
9c469db300e1b270a93c6b04c1709ac0f7751136 had started with the conversion
but left out another instance of incorrectly used AM_CFLAGS.

Dave Hart provided the suggestion for this fix.
2011-02-23 12:17:08 +01:00
Nick Mathewson
d1cee3b1c7 Make event_count maintainance branchless at the expense of an extra shift. Needs benchmarking 2011-02-23 01:08:54 -05:00
Nick Mathewson
efc4dc503a possible optimization: split event_queue_insert/remove into separate functions. needs testing 2011-02-23 00:59:20 -05:00
Nick Mathewson
e2e3c32239 Merge remote branch 'origin/patches-2.0' 2011-02-22 18:55:05 -05:00
Nick Mathewson
5dc200b7c8 Merge branch '20_uri_nonconformant' into patches-2.0 2011-02-22 18:53:55 -05:00
Constantine Verutin
6350e6c4c5 Add new evhttp_{connection_}set_timeout_tv() functions to set finger-grained http timeouts 2011-02-22 17:52:50 -05:00
Nick Mathewson
a11c30b5fe Merge remote branch 'origin/patches-2.0'
This branch is the big one that merges all the ntp folks' changes

Conflicts:
	configure.in
2011-02-22 17:41:27 -05:00
Nick Mathewson
2fba21d867 Make -ffunction-sections off-by-default in 2.0.x
I don't see how this can burn anybody, but I don't want to take
chances: new build options are something that should be done in an
alpha.  To turn -ffunction-sections on, pass
--enable-function-sections to configure.
2011-02-22 16:20:42 -05:00
Nick Mathewson
7d913f4c8e Remove nonfunctional enable_libevent_(install|regress)_def variables 2011-02-22 16:14:16 -05:00
Nick Mathewson
15b2408c9b Use $(), not @@, for LIBEVENT_GC_SECTIONS 2011-02-22 16:13:49 -05:00
Nick Mathewson
f95bafb608 Be explicit about how long event loops run in event.h documentation 2011-02-22 00:34:49 -05:00
Nick Mathewson
039b9bd0e3 Use %s with printf in test.sh 2011-02-22 00:31:56 -05:00
Dave Hart
9c469db300 Correct an AM_CFLAGS to an AM_CPPFLAGS in test/Makefile.am 2011-02-22 00:29:12 -05:00
Dave Hart
49e9bb7fb0 Add configure options to disable installation, regression tests
The main reason for disabling installation is if you're building
libevent as a subpackage for embedding: you want to have your main
package's "make all" build libevent, but you don't want your main
package's "make install" to install libevent.
2011-02-22 00:28:37 -05:00
Harlan Stenn
0b334799d6 Add -D_OSF_SOURCE to fix hpux builds 2011-02-22 00:26:19 -05:00
Dave Hart
0965c56356 Use the gcc -ffunction-segments feature to allow gc when linking with static libevent 2011-02-22 00:25:58 -05:00
Harlan Stenn
af08a94085 Check for getservbyname even if not on win32. 2011-02-22 00:25:30 -05:00
Harlan Stenn
833e5e9fcd Fix autoconf bracket issues; make check for getaddrinfo include netdb.h 2011-02-22 00:25:23 -05:00
Harlan Stenn
a317c068fe Skip check for zlib if we have no zlib.h 2011-02-22 00:25:18 -05:00
Harlan Stenn
05a2c22fee Make test-eof fail with a timeout if we never get an eof.
Previously, it would just wait forever.
2011-02-22 00:25:12 -05:00
Nick Mathewson
4eb281c8a9 FIX: comment internal headers used in sample code. 2011-02-22 00:24:57 -05:00
Nick Mathewson
eb692be9c8 NM: Fix sample/http-server ipv6 fixes
Fix 1: Use #include "../xyz" rather than #include <../xyz>

Fix 2: util-internal.h includes ipv6-internal.h, which in turn defines
       a replacement AF_INET6 on platforms that don't have it.  As such,
       the AF_INET6 checks shouldn't be needed.  (right?)
2011-02-22 00:24:57 -05:00
Harlan Stenn
bbf55150b6 Include util-internal.h as needed to build on platforms with no sockaddr_storage 2011-02-22 00:24:54 -05:00
Harlan Stenn
10c834c4df Include arpa/inet.h as needed on HPUX 2011-02-22 00:24:36 -05:00
Nick Mathewson
8f5cca47dd Merge remote branch 'origin/patches-2.0' 2011-02-21 23:27:23 -05:00
Nick Mathewson
63a715e125 Correctly detect and stop non-chunked http requests when the body is too long
Based on analysis and code from Bas Verhoeven and from
Constantine Verutin.
2011-02-21 23:25:13 -05:00
Nick Mathewson
deb2f73879 fix spelling mistake in whatsnew-2.0.txt 2011-02-18 16:17:22 -05:00