Dave Hart [Wed, 23 Mar 2011 20:22:57 +0000 (16:22 -0400)]
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.
Dave Hart [Wed, 23 Mar 2011 20:22:24 +0000 (16:22 -0400)]
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.
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.
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.
Nick Mathewson [Tue, 22 Feb 2011 21:20:42 +0000 (16:20 -0500)]
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.
Dave Hart [Sun, 13 Feb 2011 07:05:04 +0000 (02:05 -0500)]
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.
Nick Mathewson [Sun, 13 Feb 2011 06:27:06 +0000 (01:27 -0500)]
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?)
Nick Mathewson [Sun, 13 Feb 2011 05:41:22 +0000 (00:41 -0500)]
Make URI parser able to tolerate nonconformant URIs.
If the EVHTTP_URI_NONCONFORMANT flag is passed in (which it is when
parsing URIs we get over the wire), then we relax our checks a lot.
Specifically, we do nothing to check for correct characters in the
path, query, and fragment parts of such a URI.
We could do much more here: we could relax our hostname requirements,
deal with spaces differently/better, trap some errors but not others,
etc. But this should solve the worst user-agent compatibility issues
for now; the other issues can wait for a later release.
Nick Mathewson [Sun, 2 Jan 2011 02:37:21 +0000 (21:37 -0500)]
Fix compilation on Windows with NDEBUG
Dongsheng Song reports that when building on windows with NDEBUG, you
run into an attempt to do EVUTIL_ASSERT(x) where x is a bitfield,
which turns into _EVUTIL_NIL_CONDITION(x), which takes sizeof(x),
which is illegal. This patch fixes _EVUTIL_NIL_CONDITION to work on
bitfields too.
Nick Mathewson [Tue, 30 Nov 2010 03:44:18 +0000 (22:44 -0500)]
Try to fix an assertion failure related to close detection
f700566c removed a line from evhttp_connection_stop_detectclose that
cleared the EVHTTP_CON_CLOSEDETECT flag. I think this was an
accident, and suspect that it may be the cause of bug 3069555.
Add evhttp server alias interface, correct flagging of proxy requests.
evhttp needs to be mindful of all hostnames and addresses that clients
use to contact the main server and vhosts to know the difference between
proxy requests and non-proxy requests.
Kevin Bowling [Tue, 23 Nov 2010 03:44:10 +0000 (20:44 -0700)]
select comes from <sys/select.h> according to POSIX.1-2001, or from a
variety of other standard headers on older systems, but not <select.h>.
AIX build fix.
Nick Mathewson [Wed, 24 Nov 2010 01:31:28 +0000 (20:31 -0500)]
Handle evhttp PUT/POST requests with an empty body
When we call evhttp_get_bodylen() [when transfer-encoding isn't set],
having req->ntoread == -1 means that we have no content-length. But a
request with no content-length has no body! We were treating the
absent content-length as meaning "read till closed", which only holds
for replies, not requests.
This patch also allows PATCH requests to have a body.