Log

Author Commit Date CI Message
Nick Mathewson a3245afe 2010-11-01T14:23:33 Fix win32 build in response to fixes from win64 build.
Nick Mathewson 74a91e5a 2010-11-01T14:16:39 fix signed/unsigned warnings in http.c
Nick Mathewson f8095d64 2010-11-01T14:15:34 Fix a typo in 7484df61c981fc33db2~
Nick Mathewson 545a6114 2010-11-01T13:59:04 Fix even more win64 warnings: buffer, event_tagging, http, evdns, evrpc
Nick Mathewson 7484df61 2010-11-01T13:43:43 Fix even more win64 warnings
Nick Mathewson b6a158ca 2010-11-01T11:48:57 Rename "size" variables in win32select that were really fd counts.
Nick Mathewson 598d1336 2010-10-27T22:57:53 Try to clear up more size_t vs int/long issues.
Nick Mathewson b81217f7 2010-10-27T17:37:32 Fix signal handler types for win64.
Dimitre Piskyulev 1ae82cd8 2010-10-27T17:32:41 Set _EVENT_SIZEOF_VOID_P correctly on win32 and win64
Dimitre Piskyulev f817bfa4 2010-10-27T17:31:52 Fix some ints to evutil_socket_t; make tests pass on win64.
Nick Mathewson 19c71e74 2010-10-27T10:36:08 Fix som event_warns that should have been event_warnx
Nick Mathewson e8a903ce 2010-10-27T10:27:04 Merge remote branch 'trondn/master'
Trond Norbye f5ad31c1 2010-10-27T12:47:07 Check return value for ioctlsocket on win32
Nick Mathewson 5d389dc0 2010-10-26T22:27:57 Fix some uses of int for socket in regress
Nick Mathewson 84a7053e 2010-10-26T21:33:22 Merge remote branch 'github/20_http_read_after_write'
Nick Mathewson 73bf07fe 2010-10-26T21:33:13 Merge remote branch 'github/20_abi_breaks'
Nick Mathewson 093fb989 2010-10-26T21:33:05 Merge remote branch 'github/20_ratelim_size'
Nick Mathewson 4f20eeaa 2010-10-26T21:32:53 Merge remote branch 'github/20_chain_realign'
Nick Mathewson fbaf0770 2010-10-26T12:09:20 Fix bugs in posix thread-id calculation when sizeof(pthread_t) != sizeof(long) When pthread_t was smaller, our calculated thread IDs would include uninitialized RAM, and so our unit tests would fail because thread_ids would never match one another. When pthread_t was larger and alignment was big-endian, our calculated thread IDs would only have the most significant bytes of the pthread_t, when in practice all the entropy is in the low-order bytes. Found with help from Dagobert Michelsen.
Nick Mathewson ac1931ac 2010-10-26T11:07:26 Remove event-config.h from .gitignore; it moved to include/event2
Nick Mathewson e56ff65a 2010-10-26T11:01:58 Fix a minor syntax error that most compilers didn't care about
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 e4f34e8a 2010-10-25T22:36:23 Correct logic for realigning a chain in evbuffer_add The old logic was both too eager to realign (it would move a whole chain to save a byte) and too reluctant to realign (it would only realign when data would fit into the misaligned portion, without considering the space at the end of the chain). The new logic matches that from evbuffer_expand_singlechain: it only realigns a chain when not much data is to be moved, and there's a bunch of space to be regained. Spotted by Yan Lin.
Nick Mathewson 74c0e862 2010-10-25T21:53:15 Avoid missed-request bug when entire http request arrives before data is flushed The trigger for starting to read the first line of a request used to be, "When data has arrived and we're looking for the first line." But that's not good enough: if the entire next request gets read into our bufev->inbuf while we're still processing the current request, we'll never see any more data arrive, and so will never process it. So the fix is to make sure that whenever we hit evhttp_send_done, we call evhttp_read_cb. We can't call it directly, though, since evhttp_send_done is reachable from the user API, and evhttp_read_cb can invoke user functions, and we don't want to force everyone to have reentrant callbacks. So, we use a deferred_cb. Found by Ivan Andropov. This is bug 3008344.
Nick Mathewson 8e342e56 2010-10-25T16:09:11 Correctly count req->body_size on http usage without Content-Length There was a dumb bug where we would look at the length of the input buffer immediately _after_ we drained it.
Nick Mathewson 58a1cc6b 2010-10-25T16:00:47 Fix a bug where we would read too much data in HTTP bodies or requests. We were using evbuffer_add_buffer, which moved the entire buffer contents. But if we had a valid content_length, we only wanted to move up to the amount of data remaining in ntoread. Our bug would make us put our ntoread in the negative, which would in turn make us read all data until the connection closed. Found by Denis Bilenko. Should fix bug 2963172.
Nick Mathewson 525da3e1 2010-10-25T15:49:42 Fix Content-Length when trying send more than 100GB of data (!) on an evhttp.
Nick Mathewson f1250eb6 2010-10-25T15:23:41 add a requested docstring for event_rpcgen.CommandLine.__init__
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 2c66983a 2010-10-24T11:51:14 Simplify the logic for choosing EPOLL_CTL_ADD vs EPOLL_CTL_MOD Previously, we chose "ADD" whenever old_events==new_events, (since we expected the add to fail with EEXIST), or whenever old_events was==0, and MOD otherwise (i.e., when old_events was nonzero and not equal to new_events). But now that we retry failed MOD events as ADD *and* failed ADD events as MOD, the important thing is now to try to guess right the largest amount of the time, since guessing right means we do only one syscall, but guessing wrong means we do two. When old_events is 0, ADD is probably right (unless we're hitting the dup bug, when we'll fall back). And when old_events is set and != new_events, MOD is almost certainly right for the same reasons as before. But when old_events is equal to new events, then MOD will work fine unless we closed and reopened the fd, in which case we'll have to fall back to the ADD case. (Redundant del/add pairs are more common than closes for most use cases.) This change lets us avoid calculating new_events, which ought to save a little time in epoll.c
Nick Mathewson c281aba3 2010-10-24T11:38:29 Fix a nasty bug related to use of dup() with epoll on Linux Current versions of the Linux kernel don't seem to remove the struct epitem for a given (file,fd) combo when the fd is closed unless the file itself is also completely closed. This means that if you do: fd = dup(fd_orig); add(fd); close(fd); dup2(fd_orig, fd); add(fd); you will get an EEXIST when you should have gotten a success. This could cause warnings and dropped events when using dup and epoll. The solution is pretty simple: when we get an EEXIST from EPOLL_CTL_ADD, we retry with EPOLL_CTL_MOD. Unit test included to demonstrate the bug. Found due to the patient efforts of Gilad Benjamini; diagnosed with help from Nicholas Marriott.
Nick Mathewson bf11e7dd 2010-10-21T15:33:13 Merge branch 'http_uri_parse'
Nick Mathewson bc98f5e6 2010-10-21T14:53:21 Unit tests for evhttp_uri_set*
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 d9ffa899 2010-10-21T12:48:13 Update the HTTP regression tests to use Libevent2 apis for non-http stuff
Nick Mathewson 1f507d75 2010-10-21T12:27:16 Stop using Libevent-1 headers in regress_http
Nick Mathewson 2a3b5872 2010-10-21T12:23:10 Merge branch 'http_small_tweaks' Conflicts: http-internal.h
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 1213d3dd 2010-10-20T13:41:02 Fix a 100%-CPU bug where an SSL connection would sometimes never stop trying to write If an SSL connection becamse disabled or suspended before became open, it could (under the right circumstances) wind up without ever getting its write callback disabled. The most correct fix is probably more subtle, and involves checking all caseswhen a write callback is enabled or disabled. This fix is more blunt, and explicitly checks whether the callback should have been disabled at the end of the callback to prevent infinite looping. Diagnosed with help from Sebastian Hahn
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 a5a76e68 2010-10-19T12:35:50 Add a huge pile of tests for the new URI functions, and make them pass.
Nick Mathewson ad923a11 2010-10-19T12:33:50 Improvements to tinytest_macros.h First, handle cases where we have %s in a tt_want or tt_assert. Second, add tt_want_*_op that do a tt_*_op test, but do not exit the test on failure. We should push these upstream to tinytest some time.
Nick Mathewson eaa5f1d9 2010-10-19T11:26:59 Revise evhttp_uri_parse implementation to handle more of RFC3986
Nick Mathewson fadbfd4e 2010-10-18T14:43:54 Clean up error handling in uri_parse a little
Nick Mathewson 7d45431e 2010-10-18T14:38:48 Do not silently truncate URIs in evhttp_uri_join. Also avoid evbuffer_pullup.
Nick Mathewson 86212341 2010-10-18T14:34:20 Make evhttp_uri_parse and friends conform to memory management standards
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 e5870690 2010-10-18T13:53:31 Modernize header usage in bench_http.c
Nick Mathewson 9dc5f44a 2010-10-14T22:12:32 Increment version in git to 2.0.8-rc-dev
Nick Mathewson ef18c994 2010-10-14T18:36:07 Increment the version to 2.0.8-rc NOTE: This is not the official release until I tag it. If you see this commit, and you decide that Libevent 2.0.8-rc is now finalized, you might get something besides 2.0.8-rc.
Nick Mathewson 15be0493 2010-10-14T18:35:11 Changelog and readme for 2.0.8-rc
Nick Mathewson 4ebf9509 2010-10-14T14:40:40 Fixes for MSVC compilation
Nick Mathewson d3b096c0 2010-10-14T13:54:15 Make the --enable-gcc-warnings option include signed comparison warnings
Nick Mathewson e06f514d 2010-10-14T13:51:24 Fix signed/unsigned warnings on win32
Nick Mathewson 6be589ae 2010-10-14T13:48:40 Fix signed/unsigned warnings on opensolaris, where iov_len is signed
Nick Mathewson e5c214a4 2010-10-14T13:16:41 Fix -Wsigned-compare warnings in test/*
Nick Mathewson f2763fa8 2010-10-14T13:16:00 add limits.h to event_tagging.c so opensolaris will build
Nick Mathewson 5e4bafbb 2010-10-14T13:15:32 fix a signed/unsigned warning in kqueue.c
Nick Mathewson 02f6259f 2010-10-14T11:44:32 New unit test for ssl bufferevents starting with connected SSLs.
Nick Mathewson 93bb7d8e 2010-10-14T11:41:10 Fix a case where an ssl bufferevent with CLOSE_ON_FREE didn't close its fd This could happen when we got an SSL with a BIO already set on it.
Nick Mathewson 223ee40f 2010-10-14T10:53:26 Avoid spurious reads from just-created open openssl bufferevents When handshaking, we listen for reads or writes from the transport. But when we're connected, we start out with writes enabled and reads disabled, which means we should not have the transport read for us.
Nick Mathewson 34331e45 2010-10-08T01:09:02 The corrected bufferevent filter semantics let us fix our openssl tests
Nick Mathewson ac27eb82 2010-10-08T00:59:02 Correct logic on disabling underlying bufferevents when disabling a filter Previously, whenever writing was disabled on a bufferevent_filter (or a filtering SSL bufferevent), we would stop writing on the underlying bufferevent. This would make for trouble, though, since if you implemented common patterns like "stop writing once data X has been flushed", your bufferevent filter would disable the underlying bufferevent after the data was flushed to the underlying bufferevent, but before actually having it written to the network. Now, we have filters leave their underlying bufferevents enabled for reading and writing for reading and writing immediately. They are not disabled, unless the user wants to disable them, which is now allowed. To handle the case where we want to choke reading on the underlying bufferevent because the filter no longer wants to read, we use bufferevent_suspend_read(). This is analogous to the way that we use bufferevent_suspend_write() to suspend writing on a filtering bufferevent when the underlying bufferevent's output buffer has hit its high watermark.
Nick Mathewson 34d64f8a 2010-10-12T13:46:14 Fix serious bugs in per-bufferevent rate-limiting code Our old code was too zealous about deleting the refill events that would actually make connections able to read or write again after they had run out of bandwidth. Under some circumstances, this could cause a bufferevent to never actually refill one of its rate-limiting buckets. Also, the code treated setting a per-connection rate-limit on a connection that already had a group-limit as if it were changing the limit on a connection whose allocation had already run out. This patch fixes both of those problems.
Nick Mathewson 819b1715 2010-10-12T12:59:13 Handle rate-limiting for reading on OpenSSL bufferevents correctly. We were looking at the number of bytes read on the wbio, not in the rbio. But these are usually different BIOs, and the reading is supposed to happen on the rbio.
Nick Mathewson 7ad90f6a 2010-10-09T00:02:31 Merge branch '20_internal_prio'
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 08ebd267 2010-10-07T21:06:25 Merge branch 'iovmax'
Nick Mathewson 12057035 2010-10-07T18:05:01 Turn some booleans in evconnlistener_iocp into one-bit bitfields.
Christopher Davis 62b429af 2010-10-07T13:41:39 Make iocp/listener/error work; don't accept again if lev is disabled.
Nick Mathewson 481ef920 2010-09-23T17:41:49 Fix allocation error for IOCP listeners. Probably harmless, since struct event is big
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.
Nick Mathewson fdc640b0 2010-10-05T21:34:07 Fix an EINVAL on evbuffer_write_iovec on OpenSolaris. The writev() call is limited to at most IOV_MAX iovecs (or UIO_MAXIOV, depending on whom you ask). This isn't a problem anywhere we've tested except on OpenSolaris, where IOV_MAX was a mere 16. This patch makes us go from "use up to 128 iovecs when writing" to "use up to 128 iovecs when writing, or IOV_MAX/UIO_MAXIOV, whichever is less". This is still wrong if you somehow find a platform that defines IOV_MAX < UIO_MAXIOV, but I hereby claim that such a platform is too stupid to worry about for now. Found by Michael Herf.
Nick Mathewson 5b7a3706 2010-10-05T14:29:48 Fix warnings on mingw with gcc 4.5
Nick Mathewson 145f221e 2010-10-05T13:06:32 Define symbolic constants to use in place of SHUT_RD etc
Christopher Davis e0fd8708 2010-10-05T13:01:54 Send a shutdown(SHUT_WR) before closing an http connection This avoids getting an ECONNRESET from the TCP stack. Fixes bug 2928690
Nick Mathewson 0faaee01 2010-09-30T23:15:47 Fix a spurious-call bug on epoll.c We were trying to check whether any events had really been notified on an fd before calling evmap_io_active on it, but instead we were checking for an event pointer, which was always true. In practice, this patch shouldn't change much, since epoll_wait shouldn't return an event unless there is actually an event going on. Spotted by an anonymous bug reporter on Sourceforge. Closes bug 3078425.
Nick Mathewson a8b7674c 2010-09-28T01:09:17 Merge remote branch 'github/signed_compare'
Nick Mathewson a78ac0fa 2010-09-27T16:05:20 Merge remote branch 'github/win_lib'
Nick Mathewson d49b5e33 2010-09-27T15:12:55 Do not search outside of the system directory for windows DLLs Hardens against some attacks.
Sebastian Hahn b3953927 2010-09-27T21:14:28 Fix compile in kqueue.c Commit 38d09606 removed the evsigbase pointer, but forgot to remove an assignment to it in kqueue.c.
Nick Mathewson 9c8db0f8 2010-09-23T22:45:55 Fix all warnings in the main codebase flagged by -Wsigned-compare Remember, the code int is_less_than(int a, unsigned b) { return a < b; } is buggy, since the C integer promotion rules basically turn it into int is_less_than(int a, unsigned b) { return ((unsigned)a) < b; } and we really want something closer to int is_less_than(int a, unsigned b) { return a < 0 || ((unsigned)a) < b; } . Suggested by an example from Ralph Castain
Nick Mathewson 045eef4c 2010-09-23T14:23:45 Unit tests for listener error callbacks
Simon Perreault c4be8d82 2010-09-20T12:47:39 Add error callback to evconnlistener
Nick Mathewson e1198997 2010-09-21T22:44:39 Make event.c debugging messages report fds
Nick Mathewson ec2b05ed 2010-09-21T22:23:32 Make debugging output for epoll backend more comprehensive
Nick Mathewson 90651b32 2010-09-17T00:24:50 Put internal events at highest priority (If we allow user events to starve internal events, then internal events never actually happen, signals don't get acked, etc)
Nick Mathewson 38d09606 2010-09-15T12:50:31 Remove event_base.evsigbase; nothing used it.