1869 Commits

Author SHA1 Message Date
Kevin Bowling
c2e5e22c4c xlC doesn't obey C99 comments here. autoconf isn't invoking full C99
mode.
2010-11-23 22:24:23 -05:00
Kevin Bowling
c4dc335341 Add some checks since lack of TAILQ_FOREACH doesn't imply lack of FIRST,
END, NEXT, or INSERT_BEFORE.  Quiet some warnings in XL C.
2010-11-23 22:23:31 -05:00
Kevin Bowling
2e2a3d7bb6 Reworked AIX __ss_family workaround to use AC_STRUCT_MEMBER. 2010-11-23 22:23:19 -05:00
Kevin Bowling
a3a9f6b2d9 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.
2010-11-23 22:20:22 -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
150d7d0a49 Merge remote branch 'kev009/master' 2010-11-22 20:24:03 -05:00
Kevin Bowling
e87498231c Fix IRIX build. sa_family collides with a #define in sys/socket.h on IRIX. 2010-11-22 16:40:31 -07:00
Nick Mathewson
26049c2f93 Merge remote branch 'github/20_getaddrinfo_cancel_v2' 2010-11-22 16:24:52 -05:00
Nick Mathewson
da1bf52811 Add a stress test for getaddrinfo_cancel 2010-11-22 16:24:09 -05:00
Nick Mathewson
568ac4fd1b Merge remote branches 'github/20_epoll_nochangelist_v4', 'github/20_openssl_closeonfree' and 'github/20_cloexec' 2010-11-22 15:52:34 -05:00
Nick Mathewson
ece974fbba Reorder backends in test.sh to match preference order in event.c 2010-11-22 15:51:45 -05:00
Nick Mathewson
aed7e02979 Make unit tests for epoll-with-changelist pass
The only changes needed were to handle the fact that the methodname
"epoll (with changelist)" matches the environment variable
EVENT_NOEPOLL rather than the imaginary "EVENT_EPOLL (WITH CHANGELIST)".
2010-11-22 15:51:45 -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
3ab578f848 Make sure the CLOEXEC flag is set on fds we open for base notification 2010-11-20 01:41:34 -05:00
Nick Mathewson
3a67d0bf42 Resolve an evport bug in the thread/forking test 2010-11-19 17:09:30 -05:00
Nick Mathewson
d51b2fc655 Make evdns_getaddrinfo_cancel threadsafe 2010-11-19 12:14:18 -05:00
Nick Mathewson
c7cfbcf466 Fix some more cancel-related bugs in getaddrinfo_async
Also imposed a new rule to make this much much simpler: no freeing
the getaddrinfo request until both dns callbacks have been invoked.
2010-11-19 12:08:35 -05:00
Nick Mathewson
abf01ed13a Avoid double-invocation of user callback with EVUTIL_EAI_CANCEL 2010-11-19 12:08:34 -05:00
Nick Mathewson
494186129f Use the US-English "canceled", not the UK "cancelled". 2010-11-19 12:08:29 -05:00
Nick Mathewson
8faf223ac5 Fix a memory leak in evhttp_uri_free. 2010-11-17 00:09:10 -05:00
Nick Mathewson
4f228a1fc1 Fix bug in bufferevent_connect on an openssl bufferevent that already had an fd
The problem was that we were using openssl's BIO code's shutdown flag
whenever BEV_OPT_CLOSE_ON_FREE was set.  This made the BIO close the
socket when it was freed... but it would be freed whenever we did a
setfd on the bufferevent_openssl, even the no-op setfd in
bufferevent_connect.

So instead, we just set the shutdown flag to 0, and handle closing the
fd ourselves.

Spotted by Linus Nordberg
2010-11-14 19:54:52 -05:00
Nick Mathewson
1ac5b2303a Only clear underlying callbacks when the user hasn't reset them. 2010-11-09 15:18:59 -05:00
Nick Mathewson
fc7b1b005c When closing a filtering bufferevent, clear callbacks on the underlying bufferevent
Previously, if BEV_OPT_CLOSE_ON_FREE wasn't set on a
bufferevent_filter or a filtering bufferevent_openssl, when we went
to free the filtering bufferevent, we'd leave the underlying
bufferevent unchanged.  That's not so good, since the callbacks are
set to activate stuff in the filtering bufferevent that we're about
to free.  Instead, set all the callbacks to NULL.
2010-11-09 11:43:47 -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
a38140be18 Refactor http version parsing into a single function
Based on a suggestion by Chris Davis to make
evhttp_parse_response_line tolerate odd versions too.
2010-11-09 10:14:32 -05:00
Nick Mathewson
3db6bc0079 Remove some debugging puts() calls from allow_methods test 2010-11-09 10:03:00 -05:00
Nick Mathewson
52aa419bf6 Set SO_UPDATE_ACCEPT_CONTEXT on sockets from AcceptEx so that shutdown() can work
Based on patch (and lots of debugging work) by Kelly Brock.
2010-11-05 10:12:06 -04:00
Nick Mathewson
229714d123 Fix a mistake in http documentation found by Julien Blache 2010-11-04 16:04:28 -04:00
Nick Mathewson
05124879d3 Never call evhttp_readcb while writing. 2010-11-04 14:05:08 -04:00
Felix Nawothnig
c76640b5c2 Don't disable reading from the HTTP connection after sending the request to be notified of connection-close in time 2010-11-04 14:01:26 -04:00
Nick Mathewson
75e3320efd Units test for unexpected evhttp methods. 2010-11-04 12:41:13 -04:00
Nick Mathewson
536311a46b evhttp: Return 501 when we get an unrecognized method, not 400. 2010-11-04 12:39:41 -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
9ed30de7ff Don't free evdns_request handles until after the callback is invoked
Previously, once the callback was scheduled, it was unsafe to cancel
a request, but there was no way to tell that.  Now it is safe to
cancel a request until the callback is invoked, at which point it
isn't.

Found and diagnosed by Denis Bilenko.
2010-11-04 11:05:29 -04:00
Christopher Davis
34b84b9727 Fix more wn64 warnings. 2010-11-03 23:30:29 -04:00
Nick Mathewson
78762383b7 Merge branch 'http_nolegacy_v2' 2010-11-03 15:18:34 -04:00
Nick Mathewson
985430aed1 Remove need for http_compat.h in http tests 2010-11-03 15:17:57 -04:00
Nick Mathewson
0b137f452e Stop accessing http request struct directly from in the unit tests. 2010-11-03 15:14:29 -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
c91622d18c Stop using event_compat.h in regress_http 2010-11-03 15:04:44 -04:00
Nick Mathewson
9bb8239375 Convert the rest of the http tests to be non-legacy unit tests. 2010-11-03 15:00:08 -04:00
Nick Mathewson
353402a87a Rename the confusing "base" static variable in regress_http.c 2010-11-03 14:13:20 -04:00
Nick Mathewson
8505a7449c Start porting http tests to not use legacy interfaces 2010-11-03 14:11:45 -04:00
Nick Mathewson
647e094ca2 Replace exact-version checks for HTTP/1.1 with >= or < checks 2010-11-02 15:19:12 -04:00
Joachim Bauch
aa5f55face reset "chunked" flag when sending non-chunked reply 2010-11-02 13:50:57 -04:00
Nick Mathewson
ba01456999 Use the label_len local variable in evdns instead of recalculating it over and over 2010-11-02 12:42:35 -04:00