]> granicus.if.org Git - libevent/log
libevent
12 years agoAvoid segfault on weird timeout during name lookup.
Greg Hazel [Mon, 30 Jul 2012 20:52:55 +0000 (16:52 -0400)]
Avoid segfault on weird timeout during name lookup.

If an evdns_getaddrinfo timeout happens while pending_cb is set, and
a callback is about to run, but we get a call to
evdns_getaddrinfo_gotresolve before it finishes.

Github issue #60. Thanks to Greg Hazel for patch and patience.

12 years agoCheck more setsockopt return values when binding sockets. Found by coverity
Nick Mathewson [Thu, 26 Jul 2012 14:39:05 +0000 (10:39 -0400)]
Check more setsockopt return values when binding sockets. Found by coverity

12 years agomemset sockaddr_in before using it. Found by coverity.
Nick Mathewson [Thu, 26 Jul 2012 14:38:29 +0000 (10:38 -0400)]
memset sockaddr_in before using it. Found by coverity.

12 years agoMove assignment outside tt_assert in ssl unit tests. Appeases coverity.
Nick Mathewson [Thu, 26 Jul 2012 14:37:47 +0000 (10:37 -0400)]
Move assignment outside tt_assert in ssl unit tests. Appeases coverity.

12 years agoAdd checks to various return values in unit tests. Found by coverity
Nick Mathewson [Thu, 26 Jul 2012 14:37:13 +0000 (10:37 -0400)]
Add checks to various return values in unit tests. Found by coverity

12 years agoAvoid possible needless call to writev. Found by coverity.
Nick Mathewson [Thu, 26 Jul 2012 14:34:06 +0000 (10:34 -0400)]
Avoid possible needless call to writev. Found by coverity.

12 years agoRemove unused variable; spotted by coverity
Nick Mathewson [Thu, 26 Jul 2012 14:16:47 +0000 (10:16 -0400)]
Remove unused variable; spotted by coverity

12 years agoAvoid more crashes/bad calls in unit tests; found by coverity
Nick Mathewson [Thu, 26 Jul 2012 14:04:43 +0000 (10:04 -0400)]
Avoid more crashes/bad calls in unit tests; found by coverity

12 years agoAdd some missing null checks to unit tests; found by coverity
Nick Mathewson [Thu, 26 Jul 2012 13:59:47 +0000 (09:59 -0400)]
Add some missing null checks to unit tests; found by coverity

12 years agoFix resource leaks in the unit tests; found by coverity
Nick Mathewson [Thu, 26 Jul 2012 13:53:20 +0000 (09:53 -0400)]
Fix resource leaks in the unit tests; found by coverity

12 years agoFix various check-after-dereference issues in unit tests: found by coverity
Nick Mathewson [Thu, 26 Jul 2012 13:35:43 +0000 (09:35 -0400)]
Fix various check-after-dereference issues in unit tests: found by coverity

12 years agoSet umask before calling mkstemp in unit tests. Found by coverity
Nick Mathewson [Wed, 25 Jul 2012 20:18:33 +0000 (16:18 -0400)]
Set umask before calling mkstemp in unit tests. Found by coverity

12 years agoFix possible uninitialized read in dns regression tests. Found by coverity.
Nick Mathewson [Wed, 25 Jul 2012 20:05:36 +0000 (16:05 -0400)]
Fix possible uninitialized read in dns regression tests. Found by coverity.

12 years agoRemove deadcode in http regression tests. Found by coverity.
Nick Mathewson [Wed, 25 Jul 2012 19:59:50 +0000 (15:59 -0400)]
Remove deadcode in http regression tests. Found by coverity.

12 years agoFix a memory leak on error in evhttp_uriencode
Nick Mathewson [Tue, 17 Jul 2012 15:08:25 +0000 (11:08 -0400)]
Fix a memory leak on error in evhttp_uriencode

If we ran out of memory in evhttp_uriencode when allocating the
output buffer, we would neglect to call evbuffer_free() on our
temporary buffer.  Now we always free the temporary buffer.

Fixes sourceforge issue 3539887. Thanks to Andrew Cox for reporting
this one.

12 years agoWin32: avoid crash when waiting forever on zero fds.
Nick Mathewson [Mon, 16 Jul 2012 19:34:18 +0000 (15:34 -0400)]
Win32: avoid crash when waiting forever on zero fds.

12 years agoMake event_pending() threadsafe.
Simon Liu [Thu, 14 Jun 2012 17:01:05 +0000 (01:01 +0800)]
Make event_pending() threadsafe.

(Commit message by Nick)

12 years agoAdd GCC annotations so that the vsprintf functions get checked properly
Nick Mathewson [Thu, 14 Jun 2012 17:25:10 +0000 (13:25 -0400)]
Add GCC annotations so that the vsprintf functions get checked properly

12 years agoMerge pull request #57 from rosslagerwall/memleak
Nick Mathewson [Wed, 6 Jun 2012 21:10:11 +0000 (14:10 -0700)]
Merge pull request #57 from rosslagerwall/memleak

Fix a couple of memory leaks (found with Valgrind).

12 years agoFix a couple of memory leaks (found with Valgrind).
Ross Lagerwall [Wed, 6 Jun 2012 19:57:12 +0000 (21:57 +0200)]
Fix a couple of memory leaks (found with Valgrind).

12 years agoCorrectly check for arc4random_buf
Sebastian Hahn [Fri, 1 Jun 2012 03:23:29 +0000 (05:23 +0200)]
Correctly check for arc4random_buf

Apparently it's necssary to do an explicit comparison with NULL here.
This also gets rid of a compile warning

12 years agocheck for arc4random_buf at runtime, on OS X
Greg Hazel [Tue, 29 May 2012 19:39:12 +0000 (12:39 -0700)]
check for arc4random_buf at runtime, on OS X

(Tweaked by nickm: Fix up the arcr4andom_buf OSX hack so that the
fallback case isn't compiled into the code when we have
arc4random_buf() and we are not on OSX.  Also add a comment
explaining what's up.)

12 years agoBump version to 2.0.19-stable-dev
Nick Mathewson [Thu, 3 May 2012 20:34:29 +0000 (16:34 -0400)]
Bump version to 2.0.19-stable-dev

12 years agoIncrement version to 2.0.19-stable release-2.0.19-stable
Nick Mathewson [Thu, 3 May 2012 16:33:36 +0000 (12:33 -0400)]
Increment version to 2.0.19-stable

12 years agoOops; fix the *right* windows compile issue
Nick Mathewson [Thu, 3 May 2012 16:15:11 +0000 (12:15 -0400)]
Oops; fix the *right* windows compile issue

12 years agoFix win32 build issues: sleep, pid_t
Nick Mathewson [Thu, 3 May 2012 16:05:52 +0000 (12:05 -0400)]
Fix win32 build issues: sleep, pid_t

12 years agoStart changelog for 2.0.19-stable
Nick Mathewson [Wed, 2 May 2012 21:09:11 +0000 (17:09 -0400)]
Start changelog for 2.0.19-stable

12 years agoFix evdns build with threads disabled
Nick Mathewson [Wed, 2 May 2012 20:52:27 +0000 (16:52 -0400)]
Fix evdns build with threads disabled

The last evdns change apparently broke it, by using a "base"
variable that we were only declaring with threads turned on.

12 years agoWhen retransmitting a timed-out DNS request, pick a fresh nameserver.
Nick Mathewson [Tue, 1 May 2012 23:52:55 +0000 (19:52 -0400)]
When retransmitting a timed-out DNS request, pick a fresh nameserver.

Otherwise, requests initially sent to a failing nameserver would
stay there indefinitely, even if other nameservers would work.

Fix for sourceforge bug 3518439

12 years agoMake some evdns.c debug logs more verbose
Nick Mathewson [Tue, 1 May 2012 23:52:49 +0000 (19:52 -0400)]
Make some evdns.c debug logs more verbose

12 years agodns-example.c can now take a resolv.conf file on the commandline
Nick Mathewson [Tue, 1 May 2012 21:07:50 +0000 (17:07 -0400)]
dns-example.c can now take a resolv.conf file on the commandline

12 years agoMerge remote-tracking branch 'github/20_active_prio_inv' into patches-2.0
Nick Mathewson [Tue, 1 May 2012 01:45:43 +0000 (21:45 -0400)]
Merge remote-tracking branch 'github/20_active_prio_inv' into patches-2.0

12 years agoWork-around a stupid gcov-breaking bug in OSX 10.6
Nick Mathewson [Thu, 12 Apr 2012 01:33:27 +0000 (21:33 -0400)]
Work-around a stupid gcov-breaking bug in OSX 10.6

This only affects the unit tests.

Fix found at http://rachelbythebay.com/w/2011/07/12/forkcrash/

(Backport from 2.1)

12 years agoFixed potential double-readcb execution with openssl bufferevents.
Mark Ellzey [Fri, 30 Mar 2012 19:08:40 +0000 (15:08 -0400)]
Fixed potential double-readcb execution with openssl bufferevents.

the function do_read() will call SSL_read(), and if successful, will
call _bufferevent_run_readcb() before returning to consider_reading().

consider_reading() will then check SSL_pending() to make sure all
pending data has also been read. If it does not, do_read() is called
again.

The issue with this is the possibility that the function that is
executed by _bufferevent_run_readcb() called
bufferevent_disable(ssl_bev, EV_READ) before the second do_read(); In
this case, the users read callback is executed a second time. This is
potentially bad for applications that expect the bufferevent to stay
disabled until further notice. (this is why running openssl bufferevents
without DEFER_CALLBACKS has always been troublesome).

12 years agoIf a higher-priority event becomes active, don't continue running events of the curre...
Nick Mathewson [Mon, 30 Apr 2012 21:30:48 +0000 (17:30 -0400)]
If a higher-priority event becomes active, don't continue running events of the current priority.

Bug found by Ralph Castain.

12 years agoGenerate event-config.h with a single sed script
Zack Weinberg [Fri, 27 Apr 2012 13:32:51 +0000 (09:32 -0400)]
Generate event-config.h with a single sed script

This approach should make the creation of the file more atomic, to
fix a bug reported by Dinh.

This patch has one change from Zack's original version: it avoids
$<, since Dave Hart tells me he thinks that's not so portable.

(commit message by nickm)

12 years agoMerge branch '20_periodic_event_overload_v2' into patches-2.0
Nick Mathewson [Fri, 20 Apr 2012 15:51:13 +0000 (11:51 -0400)]
Merge branch '20_periodic_event_overload_v2' into patches-2.0

12 years agoIf time has jumped so we'd reschedule a periodic event in the past, schedule it for...
Nick Mathewson [Thu, 19 Apr 2012 04:25:12 +0000 (00:25 -0400)]
If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead

Fixes an issue reported on libevent-users in the thread "a dead
looping bug when changing system time backward". Previously, if time
jumped forward 1 hour[*] and we had a one-second periodic timer event,
that event would get invoked 3600 times.  That's almost certainly not
what anybody wants.

In a future version of Libevent, we should expose the amount of time
that the callbac kwould have been invoked somehow.

[*] Forward time jumps can happen with nonmonotonic clocks, or with
clocks that jump on suspend/resume.  It can also happen from
Libevent's point of view if the user exits from event_base_loop() and
doesn't call it again for a while.

12 years agoRefactor event_persist_closure: raise and extract some common logic
Nick Mathewson [Thu, 19 Apr 2012 22:15:12 +0000 (18:15 -0400)]
Refactor event_persist_closure: raise and extract some common logic

12 years agoMerge pull request #52 from ghazel/20_evdns_probe
Nick Mathewson [Thu, 19 Apr 2012 15:11:05 +0000 (08:11 -0700)]
Merge pull request #52 from ghazel/20_evdns_probe

cancel the probe request when the server is freed, and ignore cancelled probe callbacks

12 years agoremove redundant DNS_ERR_CANCEL check, move comment
Greg Hazel [Thu, 19 Apr 2012 04:41:48 +0000 (21:41 -0700)]
remove redundant DNS_ERR_CANCEL check, move comment

12 years agocancel the probe request when the server is freed, and ignore cancelled probe callbacks
Greg Hazel [Thu, 19 Apr 2012 04:29:21 +0000 (21:29 -0700)]
cancel the probe request when the server is freed, and ignore cancelled probe callbacks

12 years agoBackport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_*
Nick Mathewson [Tue, 3 Apr 2012 22:31:08 +0000 (18:31 -0400)]
Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_*

This is a partial backport of cb9da0bf and a backport of c9635349.

Because C doesn't like us to declare identifiers starting with an
underscore, Libevent 2.1 has renamed every such identifier.  The
only change that affects a public API is that the _EVENT_LOG_*
macros have been renamed to start with EVENT_LOG instead.  The old
names are still present, but deprecated.

I'm doing this backport because it represents the deprecation of a
Libevent 2.0 interface, and folks should have the opportunity to
write code that isn't deprecated and works with both 2.0 and 2.1.

12 years agoFix the website URL in the readme
Nick Mathewson [Tue, 3 Apr 2012 21:25:36 +0000 (17:25 -0400)]
Fix the website URL in the readme

12 years agoConfigure with gcc older than 2.95
Sebastian Hahn [Tue, 3 Apr 2012 03:31:20 +0000 (05:31 +0200)]
Configure with gcc older than 2.95

I don't know why people use such ancient gcc versions, but the fix seems
straightforward enough to maybe just do it.

12 years agoAdd missing ) to changelog; spotted by rransom
Nick Mathewson [Mon, 2 Apr 2012 22:12:44 +0000 (18:12 -0400)]
Add missing ) to changelog; spotted by rransom

12 years agoFix a compilation error with MSVC 2005 due to use of mode_t
Nick Mathewson [Fri, 30 Mar 2012 14:26:50 +0000 (10:26 -0400)]
Fix a compilation error with MSVC 2005 due to use of mode_t

MSVC apparently doesn't have a mode_t defined, though mingw does.

Found by Savg He.

12 years agoFix a typo in the bufferevent documentation
Nick Mathewson [Sun, 25 Mar 2012 22:56:15 +0000 (18:56 -0400)]
Fix a typo in the bufferevent documentation

12 years agoAdd an empty changelog section for 2.0.19-stable
Nick Mathewson [Thu, 22 Mar 2012 18:35:23 +0000 (14:35 -0400)]
Add an empty changelog section for 2.0.19-stable

12 years agoBump version to 2.0.18-stable-dev
Nick Mathewson [Thu, 22 Mar 2012 18:34:01 +0000 (14:34 -0400)]
Bump version to 2.0.18-stable-dev

12 years agoBump version to 2.0.18-stable release-2.0.18-stable
Nick Mathewson [Thu, 22 Mar 2012 18:00:54 +0000 (14:00 -0400)]
Bump version to 2.0.18-stable

12 years agoAdd credits to README
Nick Mathewson [Thu, 22 Mar 2012 17:47:01 +0000 (13:47 -0400)]
Add credits to README

12 years agoChangelog for libevent 2.0.18-stable
Nick Mathewson [Thu, 22 Mar 2012 16:49:08 +0000 (12:49 -0400)]
Changelog for libevent 2.0.18-stable

12 years agoMerge remote-tracking branch 'sebastian/clang_unknown_warning_options' into patches-2.0
Nick Mathewson [Tue, 13 Mar 2012 19:49:49 +0000 (15:49 -0400)]
Merge remote-tracking branch 'sebastian/clang_unknown_warning_options' into patches-2.0

12 years agoProperly zero the kevent in kq_setup_kevent()
Sebastian Hahn [Tue, 13 Mar 2012 07:33:06 +0000 (08:33 +0100)]
Properly zero the kevent in kq_setup_kevent()

Detected by clang

12 years agoDon't do clang version detection when disabling some flags
Sebastian Hahn [Tue, 13 Mar 2012 05:40:56 +0000 (06:40 +0100)]
Don't do clang version detection when disabling some flags

When clang 2.9 was around we hoped they'd introduce support for the
normalized=id and override-init warnings by 3.0, but they haven't. We
should only add the version detection back in when clang actually
supports those warnings.

12 years agoStop crashing in evdns when nameserver probes give a weird error
Nick Mathewson [Thu, 16 Feb 2012 01:12:32 +0000 (20:12 -0500)]
Stop crashing in evdns when nameserver probes give a weird error

When a nameserver is down, we periodically try sending a "probe"
message to that nameserver to see if it has come back up.  If a
nameserver comes up, we cancel any pending probe messages.

Cancelling a probe message while handling the probe's response would
result in a access-after-free or a double-free, so when we notice that
we're about to call a nameserver up because of having received a probe
from it, we need to check whether current response is the response
from the probe.

There was a case where we didn't to that, though: when the resolver
gave us an unusual error response to our request that it resolve
google.com.  This is pretty rare, but apparently it can happen with
some weird cacheing nameservers -- the one on the mikrotik router, for
example.  Without this patch, we would crash with a NULL pointer
derefernce.

Thanks to Hannes Sowa for finding this issue and helping me track it
down.

12 years agoChanged OPENSSL_LDFLAGS to OPENSSL_LIBADD
Mark Ellzey [Tue, 14 Feb 2012 20:37:58 +0000 (15:37 -0500)]
Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD

12 years agoAdded OPENSSL_LDFLAGS env variable which is appended to SSL checks.
Mark Ellzey [Tue, 14 Feb 2012 20:01:02 +0000 (15:01 -0500)]
Added OPENSSL_LDFLAGS env variable which is appended to SSL checks.

If openssl is not installed system-wide or not compiled as a shared library,
some systems require various link flags (e.g., -ld).

12 years agoTweak the evutil_open_closeonexec patch to work on windows, old unixes.
Nick Mathewson [Sun, 12 Feb 2012 02:17:18 +0000 (21:17 -0500)]
Tweak the evutil_open_closeonexec patch to work on windows, old unixes.

Windows doesn't have a mode_t as far as I can tell.

Some unixes, iirc, don't like three-argument open without O_CREAT.

12 years agoMake uses of open() close-on-exec safe by introducing evutil_open_closeonexec.
Ross Lagerwall [Sat, 11 Feb 2012 15:23:17 +0000 (17:23 +0200)]
Make uses of open() close-on-exec safe by introducing evutil_open_closeonexec.

In a multi-process/threaded environment, opening fds internally
without the close-on-exec flag could leak fds to child processes.

12 years agoAdd an empty section to the changelog for 2.0.18-stable
Nick Mathewson [Sat, 11 Feb 2012 03:20:05 +0000 (22:20 -0500)]
Add an empty section to the changelog for 2.0.18-stable

12 years agoCorrect a name in the credits. oops
Nick Mathewson [Sat, 11 Feb 2012 03:17:59 +0000 (22:17 -0500)]
Correct a name in the credits. oops

12 years agoBump version to 2.0.17-stable-dev
Nick Mathewson [Sat, 11 Feb 2012 03:16:14 +0000 (22:16 -0500)]
Bump version to 2.0.17-stable-dev

12 years agoUpdate the credits in the readme release-2.0.17-stable
Nick Mathewson [Fri, 10 Feb 2012 23:39:31 +0000 (18:39 -0500)]
Update the credits in the readme

12 years agoFinalize the changelog
Nick Mathewson [Fri, 10 Feb 2012 23:36:10 +0000 (18:36 -0500)]
Finalize the changelog

12 years agoUpdate copyright notices to 2012
Nick Mathewson [Fri, 10 Feb 2012 22:29:53 +0000 (17:29 -0500)]
Update copyright notices to 2012

12 years agoBump version to 2.0.17-stable
Nick Mathewson [Fri, 10 Feb 2012 21:49:05 +0000 (16:49 -0500)]
Bump version to 2.0.17-stable

12 years agoIn the kqueue backend, do not report EBADF as an EV_READ
Nick Mathewson [Fri, 10 Feb 2012 16:24:51 +0000 (11:24 -0500)]
In the kqueue backend, do not report EBADF as an EV_READ

We were doing this because of (correct) reports that NetBSD gives an
EBADF when you try to add the write side of a pipe for which the
read side has been closed.  But on most kqueue platforms, that
doesn't happen, and on *all* kqueue platforms, reporting a
nonexistent fd (which we usually have if we have seen EBADF) as
readable tends to give programs a case of the vapors.

Nicholas Marriott wrote the original patch here; I did the comment
fixes.

12 years agoAvoid crash when freeing event_iocp and using event_set_mem_functions
Nick Mathewson [Thu, 9 Feb 2012 20:07:19 +0000 (15:07 -0500)]
Avoid crash when freeing event_iocp and using event_set_mem_functions

There was a calloc that needed to be an mm_calloc.

Reported by "fffvvvzz" on sourceforge.  Ticket 3486114

12 years agoBring the changelog up to date
Nick Mathewson [Tue, 7 Feb 2012 02:18:25 +0000 (21:18 -0500)]
Bring the changelog up to date

12 years agoLoop on filtering SSL reads until we are blocked or exhausted.
Nick Mathewson [Mon, 6 Feb 2012 17:24:49 +0000 (12:24 -0500)]
Loop on filtering SSL reads until we are blocked or exhausted.

This is not a perfect fix, but it's much much better than the
current buggy behavior, which could lead to filtering SSL
connections that just stopped reading.

Based on ideas by Maseeb Abdul Qadir and Mark Ellzey.

12 years agoUse C-style comments in C source files (for compatibility with compilers such as...
Greg Hewgill [Sun, 20 Nov 2011 20:41:55 +0000 (09:41 +1300)]
Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX).

12 years agoevdns: fix a bug in circular-queue implementation
Nick Mathewson [Wed, 1 Feb 2012 19:56:43 +0000 (14:56 -0500)]
evdns: fix a bug in circular-queue implementation

found by Wang Qin

12 years agoBetter workaround for Linux 3.2 edge-triggered epoll bug
Nick Mathewson [Thu, 26 Jan 2012 20:04:24 +0000 (15:04 -0500)]
Better workaround for Linux 3.2 edge-triggered epoll bug

On further investigation, it appears that this problem is limited to
AF_UNIX sockets, so let's just do the test on AF_INET sockets.

12 years agoDo a memberwise comparison of threading function tables
Nate R [Tue, 24 Jan 2012 22:15:50 +0000 (17:15 -0500)]
Do a memberwise comparison of threading function tables

Doing a memcmp risks comparing uninitialized padding bytes at the
end of the structure.

12 years agoMake event_base integrity check work on windows
Nick Mathewson [Tue, 24 Jan 2012 20:29:39 +0000 (15:29 -0500)]
Make event_base integrity check work on windows

12 years agoStart writing a changelog for 2.0.17-stable
Nick Mathewson [Tue, 24 Jan 2012 20:09:04 +0000 (15:09 -0500)]
Start writing a changelog for 2.0.17-stable

12 years agoOops:remove an accidentally committed "sleep(1)" in a unit test
Nick Mathewson [Tue, 24 Jan 2012 16:16:26 +0000 (11:16 -0500)]
Oops:remove an accidentally committed "sleep(1)" in a unit test

12 years agoWorkaround in the unit tests for an apparent epoll bug in Linux 3.2
Nick Mathewson [Tue, 24 Jan 2012 16:04:19 +0000 (11:04 -0500)]
Workaround in the unit tests for an apparent epoll bug in Linux 3.2

12 years agoFix a fd leak in event_reinit()
Nick Mathewson [Mon, 23 Jan 2012 23:15:44 +0000 (18:15 -0500)]
Fix a fd leak in event_reinit()

We were supposed to be closing the ev_signal_pair sockets.

12 years agoFix a list corruption bug when using event_reinit() with signals present
Nick Mathewson [Mon, 23 Jan 2012 22:59:16 +0000 (17:59 -0500)]
Fix a list corruption bug when using event_reinit() with signals present

While re-adding all the events, event_reinit() could add a signal
event, which could then cause evsig_add() to add the
base->sig.ev_signal event.  Later on its merry path through
base->eventqueue, event_reinit() would find that same event and give
it to event_io_add a second time.  This would make the ev_io_next
list for that fd become circular.  Ouch!

12 years agoCheck event_base correctness at end of each unit test
Nick Mathewson [Mon, 23 Jan 2012 22:43:35 +0000 (17:43 -0500)]
Check event_base correctness at end of each unit test

12 years agoAdd function to check referential integrity of an event_base
Nick Mathewson [Sat, 21 Jan 2012 17:55:15 +0000 (12:55 -0500)]
Add function to check referential integrity of an event_base

12 years agoForce strict validation of HTTP version in response.
Catalin Patulea [Tue, 10 Jan 2012 23:33:58 +0000 (18:33 -0500)]
Force strict validation of HTTP version in response.

This sometimes accepted invalid versions like 'ICY' (n = 0, major = undefined, sometimes > 1).

12 years agoSuppress a gcc warning from ignoring fwrite return in http-sample.c
Nick Mathewson [Mon, 16 Jan 2012 19:45:31 +0000 (14:45 -0500)]
Suppress a gcc warning from ignoring fwrite return in http-sample.c

Found by Steve Snyder

12 years agoFix a race condition in the dns/bufferevent_connect_hostname test.
Nick Mathewson [Mon, 9 Jan 2012 21:44:53 +0000 (16:44 -0500)]
Fix a race condition in the dns/bufferevent_connect_hostname test.

As originally written, the test would only pass if the accept()
callbacks for the evconnlistener were all invoked before the last of
the CONNECTED/ERROR callbacks for the connecting/resolving bufferevent
had its call to event_base_loopexit() complete.  But this was only
accidentally true in 2.0, and might not be true at all in 2.1 where
we schedule event_base_once() callbacks more aggressively.

Found by Sebastian Hahn.

12 years agoMake evconnlistener work around bug in older Linux when getting nmapped
Nick Mathewson [Mon, 9 Jan 2012 16:49:41 +0000 (11:49 -0500)]
Make evconnlistener work around bug in older Linux when getting nmapped

Older Linuxes sometimes respond to some nmap probes by having accept()
return a success but with socklen 0.  That can lead to confusing behavior
when you go to process the sockaddr.

12 years agoRemove bogus casts of socket to int before calling ev_callback
Nick Mathewson [Mon, 9 Jan 2012 16:33:38 +0000 (11:33 -0500)]
Remove bogus casts of socket to int before calling ev_callback

This should make 64-bit windows act better.

Found by Mark Heily.

13 years agoBackport evhttp_connection_get_bufferevent to Libevent 2.0
Arno Bakker [Wed, 14 Dec 2011 21:17:19 +0000 (16:17 -0500)]
Backport evhttp_connection_get_bufferevent to Libevent 2.0

Backport by Arno Bakker; original implementation in 8d3a8500f4

13 years agoSlightly clarify evbuffer_peek documentation
Nick Mathewson [Thu, 8 Dec 2011 19:36:32 +0000 (14:36 -0500)]
Slightly clarify evbuffer_peek documentation

13 years agoFix behavior of evbuffer_peek(buf,-1,NULL,NULL,0)
Zack Weinberg [Thu, 8 Dec 2011 19:30:20 +0000 (14:30 -0500)]
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).)

13 years agocheck for sysctl before we use it
Mike Frysinger [Thu, 8 Dec 2011 16:39:48 +0000 (11:39 -0500)]
check for sysctl before we use it

Not all C libraries under Linux support the sysctl() func.

13 years agoFix a silly compilation error with the sun compiler
Colin Watt [Tue, 6 Dec 2011 18:35:54 +0000 (13:35 -0500)]
Fix a silly compilation error with the sun compiler

Apparently, other compilers were allowing "return free(x)" in a
function returning void.

13 years agoBe absolutely sure to clear pncalls before leaving event_signal_closure
Nick Mathewson [Mon, 5 Dec 2011 20:02:27 +0000 (15:02 -0500)]
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 .

13 years agoIncrement version to 2.0.16-stable-dev
Nick Mathewson [Fri, 18 Nov 2011 20:34:37 +0000 (15:34 -0500)]
Increment version to 2.0.16-stable-dev

13 years agoIncrement version to 2.0.16-stable release-2.0.16-stable
Nick Mathewson [Fri, 18 Nov 2011 20:27:06 +0000 (15:27 -0500)]
Increment version to 2.0.16-stable

13 years agoRevise 2.0.16-stable changelog
Nick Mathewson [Fri, 18 Nov 2011 20:14:50 +0000 (15:14 -0500)]
Revise 2.0.16-stable changelog

13 years agoadd comment to new consider_reading code
Nick Mathewson [Thu, 17 Nov 2011 22:42:45 +0000 (17:42 -0500)]
add comment to new consider_reading code

13 years agoAvoid spinning on OpenSSL reads
Mark Ellzey [Thu, 17 Nov 2011 16:59:41 +0000 (11:59 -0500)]
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}