include


Log

Author Commit Date CI Message
Nick Mathewson c8baac90 2011-03-07T21:55:47 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.
Tomash Brechko 5dc56628 2011-02-24T12:30:40 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.
Dave Hart b5ab9555 2011-02-25T10:35:12 Make --no-libevent-install apply to headers too
Nick Mathewson 5dc200b7 2011-02-22T18:53:55 Merge branch '20_uri_nonconformant' into patches-2.0
Nick Mathewson f95bafb6 2011-02-22T00:34:49 Be explicit about how long event loops run in event.h documentation
Nick Mathewson f6659246 2011-02-15T11:33:40 Correct evhttp_del_accept_socket documentation on whether socket is closed Thanks to Constantine Verutin for pointing this out.
Nick Mathewson 926f8165 2011-02-13T00:54:21 Clarify event_set_mem_functions doc
Nick Mathewson 95060b54 2011-02-13T00:41:22 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 57689c44 2010-12-09T12:17:11 Document that the cpu_hint is only used on Windows with IOCP for now
Nick Mathewson bb0d2b4e 2010-12-09T11:47:54 Consistentize tabs
Nick Mathewson 22f4af65 2010-12-09T11:43:12 Remove end-of-line whitespace
Constantine Verutin d23839fc 2010-12-07T11:43:52 Reject overlong http requests early when Expect:100-continue is set
Christopher Davis fa9305f8 2010-11-29T18:25:04 Preliminary support for Continue expectation in evhttp.
Christopher Davis aab8c38b 2010-11-05T11:17:07 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.
Nick Mathewson 2e5a175b 2010-11-25T23:03:46 Merge remote branch 'github/20_once_fixes'
Kevin Bowling 1cd45e56 2010-11-23T19:26:34 If not WIN32, include <sys/socket.h> in event2/util.h.
Kevin Bowling 2e2a3d7b 2010-11-23T19:09:08 Reworked AIX __ss_family workaround to use AC_STRUCT_MEMBER.
Nick Mathewson 652024b6 2010-11-23T13:08:07 Remove _event_initialized(); make event_initialized() a function(); make it consistent on windows and non-windows
Nick Mathewson 88be27dc 2010-11-23T12:26:46 Document event_get_assignment
Nick Mathewson e431bcd6 2010-11-23T12:26:34 Note that reentrant calls to libevent from logging cbs may fail badly
Nick Mathewson 7bcace2d 2010-11-22T21:02:34 Fix some irix compilation warnings spotted by Kevin Bowling
Nick Mathewson 26049c2f 2010-11-22T16:24:52 Merge remote branch 'github/20_getaddrinfo_cancel_v2'
Nick Mathewson 9531763a 2010-11-14T17:52:16 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
Nick Mathewson 49418612 2010-11-16T12:55:10 Use the US-English "canceled", not the UK "cancelled".
Nick Mathewson 057a5146 2010-11-14T19:34:49 Clarify EVLOOP_* documentation to be more precise.
Nick Mathewson 5c8a59e8 2010-11-09T10:19:05 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'
Nick Mathewson 229714d1 2010-11-04T16:04:28 Fix a mistake in http documentation found by Julien Blache
Nick Mathewson f5b391e2 2010-11-04T11:53:34 Tweak interface for allowed methods
Felix Nawothnig 75a73414 2010-11-04T11:25:35 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.
Nick Mathewson 22e0a9b2 2010-11-03T15:12:08 Add evhttp_response_code to remove one more reason to include http_struct.h
Nick Mathewson 73bf07fe 2010-10-26T21:33:13 Merge remote branch 'github/20_abi_breaks'
Nick Mathewson a4063c06 2010-10-26T10:38:30 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).
Nick Mathewson 2cbb1a16 2010-10-26T10:27:29 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.
Nick Mathewson 9c71a341 2010-10-25T15:13:32 Merge remote branch 'github/http_and_listener'
Nick Mathewson ac7e52d8 2010-10-25T14:29:30 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.
Nick Mathewson 006efa7d 2010-10-25T11:50:51 Functions to actually use evhttp_bound_socket with/as evconnlistener.
Nick Mathewson 46ee061c 2010-10-25T11:47:05 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.
Nick Mathewson bf11e7dd 2010-10-21T15:33:13 Merge branch 'http_uri_parse'
Nick Mathewson 45f6869c 2010-10-21T14:41:12 Make evhttp_uri non-public, and give it accessor functions.
Nick Mathewson 70e1b607 2010-10-21T14:05:04 Document that two bufferevent functions only work on socket bufferevents
Nick Mathewson aab49b60 2010-10-21T14:04:24 Add a bufferevent_get_base function
Nick Mathewson cd00079b 2010-10-21T12:19:28 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
Nick Mathewson 2075fbcf 2010-10-19T13:15:48 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.
Nick Mathewson 3a334628 2010-10-19T13:02:18 Document behavior of URI parsing more thoroughly. Also, move evhttp_uri struct into http.h, since it is part of the API.
Nick Mathewson eaa5f1d9 2010-10-19T11:26:59 Revise evhttp_uri_parse implementation to handle more of RFC3986
Nick Mathewson 7d45431e 2010-10-18T14:38:48 Do not silently truncate URIs in evhttp_uri_join. Also avoid evbuffer_pullup.
Pavel Plesov 86dd720a 2010-08-08T16:46:39 Introduce absolute URI parsing helpers. See evhttp_uri_parse(), evhttp_uri_free() and evhttp_uri_join() for details.
Nick Mathewson f13e449b 2010-10-18T14:20:06 Merge branch 'http_parse'
Nick Mathewson 49f4bf7c 2010-10-18T13:58:02 Add evhttp_request_get_command so code can tell GET from POST without peeking at the struct.
Nick Mathewson a8148ced 2010-10-08T13:05:13 New evhttp_uri(encode|decode) functions to handle + and NUL characters right The old evhttp_decode_uri() function would act as tough it was doing an (illegal, undefined) decode operation on a whole URL at once, and treat + characters following a ? as different from + characters preceding one. But that's not useful: If you are decoding a URI before splitting off query parameters, you are begging to fail as soon as somebody gives you a value with an encoded & in it. The new evhttp_uridecode() function takes an argument that says whether to decode + signs. Both uridecode and uriencode also now support encoding or decoding to strings with internal 0-valued characters.
Nick Mathewson 2e63a604 2010-10-08T12:57:11 evhttp_encode_uri encodes all reserved characters, including !$'()*+,/:=@ Perviously, some characters not listed as "unreserved" by RFC 3986 (notably "!$'()*+,/:=@") were not encoded by evhttp_encode_uri. This made trouble, especially when encoding path components (where @ and / are bad news) and parameters (where + should get encoded so it doesn't later decode into a space). Spotted by Bas Verhoeven.
Nick Mathewson 127d4f21 2010-09-23T16:49:58 Add a LEV_OPT_THREADSAFE option for threadsafe evconnlisteners
Nick Mathewson 3b844893 2010-10-06T12:35:38 Tweak evhttp_parse_query hack to avoid breaking abi
Nick Mathewson b1756d01 2010-10-06T11:48:52 Let evhttp_parse_query return -1 on failure We already detected certain malformed queries, but we responded by aborting the query-parsing process half-way through without telling the user. Now, if query-parsing fails, no headers are returned, and evhttp_parse_query returns -1.
Simon Perreault c4be8d82 2010-09-20T12:47:39 Add error callback to evconnlistener
Christopher Davis 2447fe88 2010-08-28T04:07:48 Add event_config_set_num_cpus_hint for tuning thread pools, etc.
Nick Mathewson 42090072 2010-09-06T15:47:07 Move the "function to getsockname() on a listener" to regress_testutils This reverts commit fab50488fcb741884ccdfa7b83643eac3e5c9cbf. The function was, on reflection, not important enough to break the feature freeze, since it's trivial to build on your own.
Nick Mathewson c51826ff 2010-09-06T15:40:13 Merge remote branch 'github/sysqueue_include_order'
Nick Mathewson 19521436 2010-09-03T16:42:16 Expose a function to add a nameserver by sockaddr
Nick Mathewson fab50488 2010-09-03T16:41:16 Expose a function to getsockname() on a listener's fd.
Nick Mathewson ca9048f1 2010-09-02T11:36:44 Move evkeyvalq into a separate header for evhttp_parse_query users The evhttp_parse_query API is a bit misdesigned; all the other evkeyvalq stuff is abstract and lets you get away with having a header stub, but evhttp_parse_query seems to require that you instantiate an empty evkeyvalq of your own.
Nick Mathewson d3ceca80 2010-09-02T11:27:57 Declare evkeyvalq and event_list even if event_struct.h comes before sys/queue.h Fixes bug 3036645 reported by Mihai Draghicioiu
Nick Mathewson d4977b52 2010-08-17T13:15:34 Add a condition variable backend, with implementations for pthreads and win32 The interface from the user's POV is similar to the locking implementation: either provide a structure full of function pointers, or just call evthread_use_*_threads() and everything will be okay. The internal interface is meant to vaguely resemble pthread_cond_*, which Windows people will better recognize as *ConditionVariable*.
Gilad Benjamini 60433a0a 2010-08-13T17:08:59 Clean up syntax on TAILQ_ENTRY() usage Though the C standards allow it, it's apparently possible to get MSVC upset by saying "struct { int field; } (declarator);" instead of "struct {int field; } declarator;", so let's just not do that. Bugfix for 3044492 (commit msg by nickm)
Nick Mathewson a4af9be1 2010-08-13T11:41:37 Make include/event2/event-config.h not included in source dist As a generated file, it shouldn't get included in our source distribution. Apparently there is an automake incant for this: nobase_ even stacks with nodist_ .
Nick Mathewson 33200e72 2010-08-10T15:03:14 Document that DNS_NO_SEARCH is an obsolete alias for DNS_QUERY_NO_SEARCH
Nick Mathewson 3808168d 2010-08-10T15:02:50 Completely remove the (mostly-removed) obsolete thread functions.
Nick Mathewson ec347b92 2010-07-07T16:45:03 Move event-config.h to include/event2 This change means that all required include files are in event2, and all files not in event2/* are optional.
Nick Mathewson 6ae53d67 2010-08-04T15:44:08 Add an interface to expose min_share in ratelimiting groups
Nick Mathewson cc2379d2 2010-07-26T14:48:32 Constify a couple of arguments to evdns_server_request_add_*_reply
Nick Mathewson e1c1167c 2010-07-22T14:38:08 Replace (unused,always 0) is_tcp argument to evdns_add_server_port*() with flags Since we weren't using it for anything, and we always failed if it was set, we're allowed to change the future semantics of setting it.
Nick Mathewson 215e629c 2010-06-21T12:26:21 Add bufferevent_lock()/bufferevent_unlock() Although bufferevent operations are threadsafe, sometimes you need to make sure that a few operations on a single bufferevent will all be executed with nothing intervening. That's what these functions are for.
Nick Mathewson 7b259b67 2010-06-21T12:24:49 Fix sentence fragment in docs for event_get_struct_event_size()
Nick Mathewson e21f5d15 2010-06-19T18:21:40 Document a change in the semantics of event_get_struct_event_size()
Nick Mathewson 276e7ee9 2010-06-11T11:57:13 Fix a pedantic gcc 4.4 warning in event2/event.h
Nick Mathewson 17a8e2d7 2010-06-07T12:06:43 Add a function to retrieve the other side of a bufferevent pair
Felix Nawothnig 06bd0563 2010-05-26T12:50:59 Fix the default HTTP error template The current template... <HTML><HEAD><TITLE>%s</TITLE> </HEAD><BODY> <H1>Method Not Implemented</H1> Invalid method in request<P> </BODY></HTML> is highly confusing. The given title is easily overlooked and the hard-coded content is just plain wrong in most cases (I really read this as "the server did not understand the requested HTTP method) This patch changes the template to include the error reason in the body as well as in the header, and to infer the proper reason from the status code whenever the reason argument is NULL. This patch also removes a redundant evhttp_add_header from evhttp_send_error; evhttp_send_page already adds a "Connection: close" header.
Nick Mathewson fdfc3fc5 2010-05-13T11:23:12 Remove the now-unusable EVTHREAD_LOCK/UNLOCK constants
Nick Mathewson 7c519dfd 2010-05-08T23:29:29 Fix some autoconf issues on OpenBSD Issue 1: autoconf gets accept when a header works properly with cpp but not with cc. This was true of the sys/sysctl.h header on openbsd. The fix: include sys/param.h (if present) when testing for sys/sysctl.h Issue 2: Somehow, autoconf's macro generation code is messed up on some versions of openbsd (including mine, and other people's too) so that instead of SIZEOF_VOID_P, it makes SIZEOF_VOID__. evutil/util.h now works around that.
Nick Mathewson a62c8433 2010-05-06T14:16:50 Merge commit 'chrisd/connect-hostname-report-err'
Nick Mathewson c16e6844 2010-05-04T13:27:36 Rename current_base symbol to event_global_current_base_ The "current_base" symbol was never actually declared in an exported header; it's hideously deprecated, and it was the one remaining exported symbol (fwict) that was prefixed with neither ev nor bufferevent nor _ev nor _bufferevent. codesearch.google.com turns up no actual attempts to use our current_base from outside libevent.
Joachim Bauch a5208fe4 2010-04-27T13:42:26 Release locks on bufferevents while executing callbacks This fixes a dead lock for me where bufferevents in different event loops use each other and access their input/output buffers (proxy-like scenario).
Christopher Davis 0ef40706 2010-04-24T00:06:38 Report DNS error when lookup fails during bufferevent_socket_connect_hostname.
Nick Mathewson a5bf43ab 2010-03-04T01:14:32 Document evutil_secure_rng_init() and evutil_secure_rng_add_bytes()
Sebastian Sjöberg 899c1dcc 2010-04-14T15:42:57 Replace EVUTIL_CLOSESOCKET macro with a function The EVUTIL_CLOSESOCKET() macro required you to include unistd.h in your source for POSIX. We might as well turn it into a function: an extra function call is going to be cheap in comparison with the system call. We retain the EVUTIL_CLOSESOCKET() macro as an alias for the new evutil_closesocket() function. (commit message from email by Nick and Sebastian)
Shuo Chen 755fbf16 2010-04-14T14:27:29 Add void* arguments to request_new and reply_new evrpc hooks This makes evprc setup more extensible, and helps with Shuo Chen's work on implementing Google protocol buffers rpc on top of Libevent 2 evrpc. This patch breaks binary compatibility with previous versions of Libevent, since it changes struct evrpc and the signature of evrpc_register_generic(). Since all compliant code should be calling evrpc_register_generic via EVRPC_REGISTER, it shouldn't break source compatibility. (Code by Shuo Chen; commit message by Nick)
Shuo Chen 07edf784 2010-04-14T14:23:03 Expose the request and reply members of rpc_req_generic() This code adds two accessor functions to evprc, and helps integrate evrpc with Google protocol buffers. (Code by Shuo Chen; commit message by nickm)
Nick Mathewson eb86c8c5 2010-04-12T22:24:54 Add evbuffer_copyout to copy data from an evbuffer without draining The evbuffer_remove() function copies data from the front of an evbuffer into an array of char, and removes the data from the buffer. This function behaves the same, but does not remove the data. This behavior can be handy for lots of protocols, where you want the evbuffer to accumulate data until a complete record has arrived. Lots of people have asked for a function more or less like this, and though it isn't too hard to code one from evbuffer_peek(), it is apparently annoying to do it in every app you write. The evbuffer_peek() function is significantly faster, but it requires that the user be able to handle data in separate extents. This patch also reimplements evbufer_remove() as evbuffer_copyout() followed by evbuffer_drain(). I am reasonably confident that this won't be a performance hit: the memcpy() overhead should dominate the cost of walking the list an extra time.
Nick Mathewson fb366c1d 2010-03-21T13:16:31 Functions to track the total bytes sent over a rate limit group.
Nick Mathewson ee41aca6 2010-03-12T00:46:39 Functions to manipulate existing rate limiting groups. This patch adds a function to change the current rate limit of a rate limiting group, and another to free an empty rate limiting group.
Nick Mathewson b2f2be6e 2010-03-10T16:25:16 Make evdns use the regular logging system by default Once, for reasons that made sense at the time, we had evdns.c use its own logging subsystem with two levels, "warn" and "debug". This leads to problems, since setting a log handler for Libevent wouldn't actually trap these messages, since they weren't on by default, and since some of the warns should really be msgs. This patch changes the default behavior of evdns.c to log to event_(debugx,warnx,msgx) by default, and adds a new (internal-use-only) log level of EVDNS_LOG_MSG. Programs that set a evdns logging function will see no change. Programs that don't will now see evdns warnings reported like other warnings.
Nick Mathewson 17efc1cd 2010-03-04T01:25:51 Update all our copyright notices to say "2010"
Nick Mathewson 2fac0f70 2010-03-03T12:15:15 Remove signal_assign() and signal_new() macros. These were introduced and deprecated in the same version (2.0.1-alpha), presumably in two-stage process. Everybody sane should be using evsignal_assign() and evsignal_new() instead.
Nick Mathewson d3288293 2010-02-20T18:44:35 Provide consistent, tested semantics for bufferevent timeouts The different bufferevent implementations had different behavior for their timeouts. Some of them kept re-triggering the timeouts indefinitely; some disabled the event immediately the first time a timeout triggered. Some of them made the timeouts only count when the bufferevent was actively trying to read or write; some did not. The new behavior is modeled after old socket bufferevents, since they were here first and their behavior is relatively sane. Basically, each timeout disables the bufferevent's corresponding read or write operation when it fires. Timeouts are stopped whenever we suspend writing or reading, and reset whenever we unsuspend writing or reading. Calling bufferevent_enable resets a timeout, as does changing the timeout value.
Nick Mathewson 162ce8a8 2010-02-23T00:38:30 Expose view of current rate limit as constrained by group limit
Nick Mathewson 4faeaea9 2010-02-19T03:39:50 Clean up formatting: function/keyword spacing consistency. - Keywords always have a space before a paren. Functions never do. - No more than 3 blank lines in a row.
Nick Mathewson e5cf9879 2010-02-18T17:46:56 Clean up formatting: remove trailing spaces
Nick Mathewson e5bbd40a 2010-02-18T17:41:15 Clean up formatting: use tabs, not 8-spaces, to indent.
Nick Mathewson 8fdf09c0 2010-02-18T17:08:50 Clean up formatting: Disallow space-before-tab.
Nick Mathewson ca46d25b 2010-02-17T23:02:28 Merge branch 'arc4random'