2157 Commits

Author SHA1 Message Date
Zack Weinberg
c986f2321d Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0)
(Patch altered by nickm to not affect the behavior of
evbuffer_peek(buf,-1,NULL,vec,n_vec).)
2011-12-08 14:31:09 -05:00
Mike Frysinger
358c745e54 check for sysctl before we use it
Not all C libraries under Linux support the sysctl() func.
2011-12-08 11:39:48 -05:00
Colin Watt
19277763b2 Fix a silly compilation error with the sun compiler
Apparently, other compilers were allowing "return free(x)" in a
function returning void.
2011-12-06 13:35:54 -05:00
Nick Mathewson
11f36a5f76 Be absolutely sure to clear pncalls before leaving event_signal_closure
I thought we'd fixed the cases where this could come up, but
apparently having an event_base_break() happen while processing
signal events could get us in trouble.

Found by Remi Gacogne.  Sourceforge issue 3451433 .
2011-12-05 15:06:46 -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
31c99bd28f Revise 2.0.16-stable changelog 2011-11-18 15:14:50 -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
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
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
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
Gisle Vanem
a3f320e83d Improve win32 behavior of dns-sample.c codex 2011-11-09 00:17:56 -05:00
Mansour Moufid
674bc6a29e Fix typo in whatsnew-2.0.txt 2011-11-03 11:43:49 -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
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
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
Nick Mathewson
3c824bd334 Update copyright dates to 2011. 2011-10-24 13:18:09 -04:00
Nick Mathewson
724bfb56ef Add note about evhttp_send_reply_end to its doxygen 2011-10-19 22:59:47 -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
Leonid Evdokimov
21a08d6869 Empty DNS reply with OK status is another way to say NODATA.
Sometimes DNS reply has nothing but query section. It does not look like
error, so it should be treated as NODATA with TTL=0 as soon as there is
no SOA record to deduce negative TTL from.
2011-10-19 22:15:35 -04:00
Leonid Evdokimov
d58c15ee84 Tests for 94fba5b and f72e8f6 2011-10-19 22:15:29 -04:00
Nick Mathewson
8589f6c45b Bump version to 2.0.15-stable-dev 2011-10-12 01:00:23 -04:00
Nick Mathewson
c54c2358e5 Credit a patch from a one-named user release-2.0.15-stable 2011-10-12 00:39:22 -04:00
Nick Mathewson
4d9529fcfa Increment version to 2.0.15-stable 2011-10-12 00:22:17 -04:00
Nick Mathewson
7c3e06120b Add changelog for 2.0.15-stable 2011-10-12 00:16:12 -04:00
Greg Hazel
ba5c27d47f refer to non-deprecated evdns functions in comments 2011-10-10 11:33:15 -04:00
Nick Mathewson
706aa5f416 Merge remote-tracking branch 'github/20_addfile_ssl' into patches-2.0 2011-10-06 15:11:50 -04:00
Nick Mathewson
39c0cf7ca4 Fix some "value never used" warnings with gcc 4.6.1 2011-10-03 12:49:02 -04:00
Nick Mathewson
2b768479e4 Make write-checking fixes use tt_fail_perror 2011-10-03 12:45:36 -04:00
Mark Ellzey
c3b62fd7fd Fixed compiler warnings for unchecked read/write calls. 2011-10-03 12:40:48 -04:00
Nick Mathewson
0ba0af9c6c Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL.
The sendfile() implementation for evbuffer_add_file is potentially more
efficient, but it has a problem: you can only use it to send bytes over
a socket using sendfile().  If you are writing bytes via SSL_send() or
via a filter, or if you need to be able to inspect your buffer, it
doesn't work.

As an easy fix, this patch disables the sendfile-based implementation of
evbuffer_add_file on an evbuffer unless the user sets a new
EVBUFFER_FLAG_DRAINS_TO_FD flag on that evbuffer, indicating that the
evbuffer will not be inspected, but only written out via
evbuffer_write(), evbuffer_write_atmost(), or drained with stuff like
evbuffer_drain() or evbuffer_add_buffer().  This flag is off by
default, except for evbuffers used for output on bufferevent_socket.

In the future, it could be interesting to make a best-effort file
segment implementation that tries to send via sendfile, but mmaps on
demand.  That's too much complexity for a stable release series, though.
2011-09-29 10:32:16 -04:00
Nick Mathewson
1ef1f68462 Make evbuffer callbacks get the right n_added value after evbuffer_add
Patch from Alex.
2011-09-28 09:22:17 -04:00
Nick Mathewson
296d29a12c Merge branch '20_loopbreak_in_signal' into patches-2.0 2011-09-26 11:07:58 -04:00
Nick Mathewson
7f82382a7d Use _SOURCES, not _sources, in sample/Makefile.am
Found by Adrian Chadd
2011-09-25 07:39:00 -04:00
Sergey Avseyev
9ae061acca le-proxy and regress depend on openssl directly 2011-09-16 09:42:01 -04:00
Leonid Evdokimov
94fba5b9ac Add DNS_ERR_NODATA error code to handle empty replies. 2011-09-12 15:38:05 -04:00
Leonid Evdokimov
2b6eae5999 Fix docstring in dns.h 2011-09-12 15:09:30 -04:00
Nick Mathewson
4e8eb6a595 When a signal callback is activated to run multiple times, allow event_base_loopbreak to work even before they all have run.
Found by Abilio Marques.
2011-09-09 20:57:54 -04:00