Some hosts require you to define certain options to get a large off_t
instead of a small one, to get useful ftell and fseek calls instead of
ones that can only support 2GB files, and so on. This patch makes
Libevent support those platforms by:
* Defining the right options when we build, and
* Changing our API so that it does not depend on the platform's
definition of off_t.
Based on discusion with Michael Herf
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.
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.
Previously, debug logs were turned on if you built with -DUSE_DEBUG
and off otherwise. This make builds with -DUSE_DEBUG hideously slow
and other builds unable to get debug logs.
This is based off a patch by Ralph Castain from October. It tries a
little harder to avoid needless function calls, it doesn't require
stdbool, and makes the controlling parameter a mask rather than a
boolean so that we can later support enabling only the debugging
messages for the parts of Libevent you're trying to debug.
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.