577 Commits

Author SHA1 Message Date
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
f95bafb608 Be explicit about how long event loops run in event.h documentation 2011-02-22 00:34:49 -05:00
Nick Mathewson
8f5cca47dd Merge remote branch 'origin/patches-2.0' 2011-02-21 23:27:23 -05:00
Nick Mathewson
f665924649 Correct evhttp_del_accept_socket documentation on whether socket is closed
Thanks to Constantine Verutin for pointing this out.
2011-02-15 11:33:40 -05:00
Nick Mathewson
926f8165a7 Clarify event_set_mem_functions doc 2011-02-13 00:54:21 -05:00
Nick Mathewson
95060b54fe 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.
2011-02-13 00:41:22 -05:00
Nick Mathewson
e72afae068 Add evbuffer_add_file_segment() so one fd can be used efficiently in more than one evbuffer_add_file at a time 2010-12-20 19:25:05 -05:00
Nick Mathewson
e30a82f118 Add event_enable_debug_logging() to control use of debug logs
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.
2010-12-16 13:58:56 -05:00
Nick Mathewson
57689c4484 Document that the cpu_hint is only used on Windows with IOCP for now 2010-12-09 12:17:11 -05:00
Nick Mathewson
bb0d2b4e85 Consistentize tabs 2010-12-09 11:47:54 -05:00
Nick Mathewson
22f4af6580 Remove end-of-line whitespace 2010-12-09 11:43:12 -05:00
Constantine Verutin
d23839fc6e Reject overlong http requests early when Expect:100-continue is set 2010-12-07 11:43:52 -05:00
Christopher Davis
fa9305f8f5 Preliminary support for Continue expectation in evhttp. 2010-11-29 18:25:04 -08:00
Christopher Davis
aab8c38b76 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.
2010-11-26 03:58:28 -08:00
Nick Mathewson
2e5a175bf3 Merge remote branch 'github/20_once_fixes' 2010-11-25 23:03:46 -05:00
Kevin Bowling
1cd45e5660 If not WIN32, include <sys/socket.h> in event2/util.h. 2010-11-23 22:24:46 -05:00
Kevin Bowling
2e2a3d7bb6 Reworked AIX __ss_family workaround to use AC_STRUCT_MEMBER. 2010-11-23 22:23:19 -05:00
Nick Mathewson
652024b6b1 Remove _event_initialized(); make event_initialized() a function(); make it consistent on windows and non-windows 2010-11-23 13:08:07 -05:00
Nick Mathewson
88be27dc06 Document event_get_assignment 2010-11-23 12:26:46 -05:00
Nick Mathewson
e431bcd686 Note that reentrant calls to libevent from logging cbs may fail badly 2010-11-23 12:26:34 -05:00
Nick Mathewson
7bcace2d54 Fix some irix compilation warnings spotted by Kevin Bowling 2010-11-22 21:02:34 -05:00
Nick Mathewson
26049c2f93 Merge remote branch 'github/20_getaddrinfo_cancel_v2' 2010-11-22 16:24:52 -05:00
Nick Mathewson
9531763ab0 Disable changelist for epoll by default because of Linux dup() bug; add an option and/or an envvar to reenable it for speed.
Rename option to control epoll changelist; make epoll changelist off by default
2010-11-22 15:50:36 -05:00
Nick Mathewson
494186129f Use the US-English "canceled", not the UK "cancelled". 2010-11-19 12:08:29 -05:00
Nick Mathewson
057a51468e Clarify EVLOOP_* documentation to be more precise. 2010-11-14 19:34:49 -05:00
Nick Mathewson
5c8a59e886 Merge remote branches 'github/20_evdns_cancel_segfault_v2', 'github/20_http_close_detect', 'github/20_http_versions', 'github/20_more_http_methods', 'github/20_shutdown_iocp_listener' and 'github/20_win64_fixes' 2010-11-09 10:19:05 -05:00
Nick Mathewson
229714d123 Fix a mistake in http documentation found by Julien Blache 2010-11-04 16:04:28 -04:00
Nick Mathewson
f5b391e22e Tweak interface for allowed methods 2010-11-04 11:53:36 -04:00
Felix Nawothnig
75a73414a4 Define enumerators for all HTTP methods, including PATCH from RFC5789
This patch defines enumerators for all HTTP methods that exist
(including PATCH introduced in RFC 5789).

It also makes them bit-masky (that's not a word, is it?), breaking
binary- but not source-code compatibility.

evhttp now stores a bitmask specifying for which methods requests to
dispatch and which ones to reject with "405 Method Not Allowed".

By default that's the ones we currently have (GET, POST, HEAD, PUT,
DELETE), thereby keeping functional compatibility (besides the minor
change that one of the other methods will now cause 405 instead of
400. But I believe that could even be considered a bug-fix).

evhttp is extended by evhttp_set_allowed_methods() with which the
user can change that bitmask.

no regressions here and my test-app still works. Haven't yet
actually tested any of the new methods.

What's obviously missing here is the special logic for the methods:

OPTIONS: We should be fine here - I believe our current dispatch
logic should work fine. Some convenience functions would be fine
though.

TRACE: I'm pretty certain we should never dispatch this to the
callbacks and simply implement the necessary functionality built-in.

CONNECT: Pretty straight-forward to implement (and considering the
framework in which we implement it very efficient too). Should
probably go built-in.

PATCH: Except for checking the RFC against our pre-dispatch logic
(there just might be some "MUST not have Some-Header" lurking
somewhere) there is nothing to be done here, this is completely up
to the user. Nothing to do.
2010-11-04 11:53:36 -04:00
Nick Mathewson
22e0a9b2e8 Add evhttp_response_code to remove one more reason to include http_struct.h 2010-11-03 15:12:08 -04:00
Nick Mathewson
73bf07fe9b Merge remote branch 'github/20_abi_breaks' 2010-10-26 21:33:13 -04:00
Nick Mathewson
a4063c06f9 Note that 2.0.9 will break the ABI, and make changes we were postponing.
We had to turn a couple of 32-bit size arguments into 64-bit arguments
or size_t arguments (since otherwise we would have had to do it post
2.0.x-stable, and that would be worse).
2010-10-26 10:38:30 -04:00
Nick Mathewson
2cbb1a161e Make rate-limits go up to SIZE_MAX/EV_SSIZE_MAX, not just INT32_MAX
Someday, when networks are far faster and people frequently want a
burst value greater than 2GB per tick, this will seem very forsightful
indeed.

For now, it breaks ABI, but not source.  Fixes bug 3092096.
2010-10-26 10:27:29 -04:00
Nick Mathewson
9c71a3413a Merge remote branch 'github/http_and_listener' 2010-10-25 15:13:32 -04:00
Nick Mathewson
ac7e52d84d Make evbuffer_add_file take ev_off_t, not off_t
This change has no effect on non-windows platforms, since those
either define off_t to 64-bits, or allow you to decide whether
it should be 64-bits yourself via some LARGEFILE-like macro.

On Windows, however, off_t is always 32-bit, so it's a bad choice
for "file size" or "file offset" values.  Instead, I'm adding
an ev_off_t type, and using it in the one place where we used
off_t to mean "the size of a file" or "an offset into a file" in the
API.

This breaks ABI compatibility on Windows.
2010-10-25 14:29:30 -04:00
Nick Mathewson
006efa7dbb Functions to actually use evhttp_bound_socket with/as evconnlistener. 2010-10-25 11:50:51 -04:00
Nick Mathewson
46ee061ca0 Add a function to change a listener's callback.
You can also now initialize listeners with no callbacks set; if so,
they won't get enabled until the callback is set to non-NULL.
2010-10-25 11:47:05 -04:00
Nick Mathewson
bf11e7ddf7 Merge branch 'http_uri_parse' 2010-10-21 15:33:13 -04:00
Nick Mathewson
45f6869c75 Make evhttp_uri non-public, and give it accessor functions. 2010-10-21 14:52:52 -04:00
Nick Mathewson
70e1b607d6 Document that two bufferevent functions only work on socket bufferevents 2010-10-21 14:05:04 -04:00
Nick Mathewson
aab49b6069 Add a bufferevent_get_base function 2010-10-21 14:04:24 -04:00
Nick Mathewson
cd00079b22 Add evhttp_connection_get_base() to get the event_base from an http connection
Based on a patch by Mark Ellzey from 27 July 2010.

Closes ticket 3052406
2010-10-21 12:19:28 -04:00
Nick Mathewson
2075fbcff0 Add evhttp_parse_query_str to be used with evhttp_uri_parse.
The old evhttp_parse_query() doesn't work well with struct
evhttp_uri.query, since it expects to get whole URIs, rather than
just the query portion.
2010-10-19 13:15:48 -04:00
Nick Mathewson
3a33462827 Document behavior of URI parsing more thoroughly.
Also, move evhttp_uri struct into http.h, since it is part of the API.
2010-10-19 13:02:18 -04:00
Nick Mathewson
eaa5f1d9ed Revise evhttp_uri_parse implementation to handle more of RFC3986 2010-10-19 11:26:59 -04:00
Nick Mathewson
7d45431e15 Do not silently truncate URIs in evhttp_uri_join. Also avoid evbuffer_pullup. 2010-10-18 14:38:48 -04:00
Pavel Plesov
86dd720a66 Introduce absolute URI parsing helpers.
See evhttp_uri_parse(), evhttp_uri_free() and evhttp_uri_join() for details.
2010-10-18 14:30:29 -04:00