2691 Commits

Author SHA1 Message Date
Catalin Patulea
f7eb69ace4 bev_ssl: Be more specific in event callbacks. evhttp in particular gets confused without at least one of BEV_EVENT_{READING|WRITING}. 2011-11-24 12:18:23 -05:00
Nick Mathewson
3596a31d63 Merge remote-tracking branch 'origin/patches-2.0' 2011-11-18 15:35:33 -05:00
Nick Mathewson
ba4d66961e Increment version to 2.0.16-stable-dev 2011-11-18 15:34:37 -05:00
Nick Mathewson
5de3fa3208 Increment version to 2.0.16-stable release-2.0.16-stable 2011-11-18 15:27:06 -05:00
Nick Mathewson
044c41de84 Merge remote-tracking branch 'origin/patches-2.0' 2011-11-18 15:16:11 -05:00
Nick Mathewson
31c99bd28f Revise 2.0.16-stable changelog 2011-11-18 15:14:50 -05:00
Nick Mathewson
9ee9e943a8 Merge remote-tracking branch 'origin/patches-2.0' 2011-11-18 14:23:13 -05:00
Nick Mathewson
ebf82199df add comment to new consider_reading code 2011-11-17 17:42:45 -05:00
Mark Ellzey
2aa036fa04 Avoid spinning on OpenSSL reads
Previously, if some sender were generating data to read on an
OpenSSL connection as fast as we could process it, we could easily
wind up looping on an openssl do_read operation without ever
considering other sockets.

The difference between this and the original method in
consider_reading() is that it only loops for a single completed
*frame* instead of looping until fd is drained or an error condition
was triggered.

{Patch split out by nickm}
2011-11-17 11:59:41 -05:00
Nick Mathewson
96c562fa49 Move SSL rate-limit enforcement into bytes_to_read() 2011-11-17 11:54:07 -05:00
Mark Ellzey
a186e73200 Refactor amount-to-read calculations in buffervent_ssl consider_reading()
Split up consider_reading()'s conditional checks into another function
can_read() for simplicity sake.

{Split into a separate patch by nickm}
2011-11-17 11:45:49 -05:00
Nick Mathewson
6660c9a347 Revert "Avoid potential SSL read spinlocks"
This reverts commit fc52dbac87f4937f8306759506d6a2ad15ca244c.
2011-11-15 18:34:24 -05:00
Nick Mathewson
a62346dec7 Revert "openssl bufferevent has the same issue with writing as prior commit."
This reverts commit 7353663eb7c0b2a1caaaa5acd818515f156cf2ca.
2011-11-15 18:33:50 -05:00
Nick Mathewson
fe9e831ffb Merge remote-tracking branch 'origin/patches-2.0' 2011-11-15 17:22:45 -05:00
Nick Mathewson
34045c8fd4 Add new entries to changelog, new credits to README 2011-11-15 17:22:12 -05:00
Nick Mathewson
b17b0eec02 Fix DNS memleak checks when running with malloc-replacement/debugging disabled 2011-11-15 17:11:42 -05:00
Nick Mathewson
f5b937e65f Merge remote-tracking branch 'origin/patches-2.0' 2011-11-14 18:22:08 -05:00
Nick Mathewson
e787413329 Don't try to make notifiable event_base when no threading fns are configured 2011-11-14 17:33:02 -05:00
Nick Mathewson
4e797f388f Warn when unable to construct base because of failing make_base_notifiable 2011-11-14 17:32:22 -05:00
Nick Mathewson
2ebc8c80bf Merge remote-tracking branch 'origin/patches-2.0' 2011-11-14 11:55:37 -05:00
Mark Ellzey
7353663eb7 openssl bufferevent has the same issue with writing as prior commit. 2011-11-14 11:52:59 -05:00
Mark Ellzey
fc52dbac87 Avoid potential SSL read spinlocks
OpenSSL bufferevents with deferred callbacks enabled under high load will
spinlock in the function consider_reading(). This loop continues until all
data has been read.

Because of this condition; openssl bufferevents will never return back into
event_base_loop() until SSL_read has determined data is no longer ready.

As of yet I have not found a reason why this while loop exists, so this patch
just swaps out while for if.

If needed I can write same code which would trigger this effect; optionally
libevhtp has a test.c program which can be run with the following flags:

./test -s <keyfile.pem>

curl -vvvv -k -d@<HUGE_ASS_FILE> https://127.0.0.1:8081/

The return data will include the number of times the readcb got data and the
length of that read.

Without this patch, you are likely to see a small amount of "bytes read....",
otherwise the "bytes read..." return data should show much more reasonable
numbers.
2011-11-14 11:52:51 -05:00
Nick Mathewson
9ae6e5959d Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	sample/dns-example.c
2011-11-14 11:45:17 -05:00
Nick Mathewson
54142c9458 unit tests for EVBUFFER_EOL_NUL 2011-11-14 11:43:31 -05:00
Andrea Montefusco
d7a8b36eaf New EVBUFFER_EOL_NUL to read NUL-terminated strings from an evbuffer 2011-11-14 11:42:52 -05:00
Nick Mathewson
27b5398fe0 Tweaks, fixups, and comments on evbuffer_add_iovec 2011-11-11 17:56:08 -05:00
Mark Ellzey
aaec5aca01 Added evbuffer_add_iovec and unit tests. 2011-11-11 17:39:28 -05:00
Gisle Vanem
a3f320e83d Improve win32 behavior of dns-sample.c codex 2011-11-09 00:17:56 -05:00
Nick Mathewson
95af043314 Merge remote-tracking branch 'origin/patches-2.0' 2011-11-03 11:45:43 -04:00
Mansour Moufid
674bc6a29e Fix typo in whatsnew-2.0.txt 2011-11-03 11:43:49 -04:00
Nick Mathewson
dea055d026 Merge remote-tracking branch 'github/20_evbuffer_remove_bug' 2011-11-02 23:15:07 -04:00
Nick Mathewson
c882a95956 Merge remote-tracking branch 'origin/patches-2.0' 2011-11-02 23:14:24 -04:00
Nick Mathewson
b18c04dd74 Use the free-trailing-chains function in evbuffer_insert_chain too 2011-11-02 22:50:47 -04:00
Nick Mathewson
c37069cd79 Fix an evbuffer crash in evbuffer_remove_buffer()
Found by Greg Hazel.
2011-11-02 22:48:16 -04:00
Greg Hazel
7eb52eb85e improve test to remove at least one buffer from src 2011-11-02 22:47:02 -04:00
Greg Hazel
90bd620fa3 unit test for remove_buffer bug 2011-11-02 13:40:16 -04:00
Nick Mathewson
0014591865 Merge remote-tracking branch 'origin/patches-2.0' 2011-10-30 22:34:00 -04:00
Nick Mathewson
447b0bad15 Fix compile warning from saying event2/*.h inside a comment
Based on a patch by Adrian Chadd
2011-10-30 22:32:18 -04:00
Nick Mathewson
0cb70e3333 Merge remote-tracking branch 'origin/patches-2.0' 2011-10-26 10:17:21 -04:00
Jamie Iles
1aee718362 epoll: close fd on alloc fail at initialization
If the memory allocations fail then we free any other allocated
structures but don't close the file descriptor resulting in an leak of
fd's.
2011-10-26 10:14:49 -04:00
Samy Al Bahra
a2c48e3be8 evhttp: Add evhttp_foreach_bound_socket.
Applies the function specified in the first argument to all
evhttp_bound_sockets associated with a struct evhttp. The user
must not attempt to free or remove any connections, sockets or
listeners in the callback function.
2011-10-25 22:17:24 -04:00
Nick Mathewson
356554c8dc Merge remote-tracking branch 'origin/patches-2.0' 2011-10-25 11:43:01 -04:00
Nick Mathewson
3c824bd334 Update copyright dates to 2011. 2011-10-24 13:18:09 -04:00
Abel Mathew
212533e4a1 New event_base_update_cache_time() to set cached_tv to current time
This function is particularly useful for selectively increasing
the accuracy of the cached time value in 'base' during callbacks
that take a long time to execute.

This function has no effect if the base is currently not in its
event loop or if timeval caching is disabled via EVENT_BASE_FLAG_NO_CACHE_TIME.
2011-10-21 18:08:08 -04:00
Mansour Moufid
c8953d1b48 Add argument checks to some memory functions in `event.c'.
Add a zero check to the function `event_mm_malloc_',
i.e. simply return NULL if the sz argument is zero.
On failure, set errno to ENOMEM and return NULL.

Add a zero check to the function `event_mm_calloc_',
i.e. simply return NULL if either argument is zero.
Also add an unsigned integer multiplication check, and if an integer
overflow would occur, set errno to ENOMEM and return NULL.
On failure, set errno to ENOMEM and return NULL.

Add a NULL check to the function `event_mm_strdup_',
i.e. set errno to EINVAL and return NULL.
Also add an unsigned integer addition check, and if an integer
overflow would occur, set errno to ENOMEM and return NULL.
If a memory allocation error occurs, again set errno to ENOMEM
and return NULL.

Add unit tests to `test/regress_util.c'.
2011-10-19 23:21:57 -04:00
Nick Mathewson
724bfb56ef Add note about evhttp_send_reply_end to its doxygen 2011-10-19 22:59:47 -04:00
Nick Mathewson
128c8d6c0f Merge remote-tracking branch 'origin/patches-2.0' 2011-10-19 22:44:33 -04:00
Leonid Evdokimov
9e6a4efa51 More detailed message in case of libevent self-debugging failure. 2011-10-19 22:41:15 -04:00
Nick Mathewson
5e42202d59 Style and comment tweaks for dns/leak* tests 2011-10-19 22:41:11 -04:00
Leonid Evdokimov
f7841bfc70 Test for commit aff6ba1 2011-10-19 22:34:09 -04:00