2213 Commits

Author SHA1 Message Date
Zack Weinberg
30b6f889f7 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)
2012-04-27 09:32:51 -04:00
Nick Mathewson
03614a16cb Merge branch '20_periodic_event_overload_v2' into patches-2.0 2012-04-20 11:51:13 -04:00
Nick Mathewson
dfd808cbad 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.
2012-04-19 18:25:59 -04:00
Nick Mathewson
bec22b4176 Refactor event_persist_closure: raise and extract some common logic 2012-04-19 18:15:12 -04:00
Nick Mathewson
37c4fc8d0c Merge pull request #52 from ghazel/20_evdns_probe
cancel the probe request when the server is freed, and ignore cancelled probe callbacks
2012-04-19 08:11:05 -07:00
Greg Hazel
46b806084e remove redundant DNS_ERR_CANCEL check, move comment 2012-04-18 21:41:48 -07:00
Greg Hazel
94d2336070 cancel the probe request when the server is freed, and ignore cancelled probe callbacks 2012-04-18 21:29:21 -07:00
Nick Mathewson
d1a03b2ff1 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.
2012-04-03 18:31:08 -04:00
Nick Mathewson
f775521c31 Fix the website URL in the readme 2012-04-03 17:25:36 -04:00
Sebastian Hahn
4a6fd43313 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.
2012-04-03 05:37:31 +02:00
Nick Mathewson
4c7ee6b0c9 Add missing ) to changelog; spotted by rransom 2012-04-02 18:12:44 -04:00
Nick Mathewson
336dcaeaef 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.
2012-03-30 10:26:50 -04:00
Nick Mathewson
98e9119fab Fix a typo in the bufferevent documentation 2012-03-25 18:56:15 -04:00
Nick Mathewson
25a424fb8c Add an empty changelog section for 2.0.19-stable 2012-03-22 14:35:23 -04:00
Nick Mathewson
f0fb2c271c Bump version to 2.0.18-stable-dev 2012-03-22 14:34:01 -04:00
Nick Mathewson
75401035f0 Bump version to 2.0.18-stable release-2.0.18-stable 2012-03-22 14:00:54 -04:00
Nick Mathewson
90c0a7df84 Add credits to README 2012-03-22 13:47:01 -04:00
Nick Mathewson
7734292652 Changelog for libevent 2.0.18-stable 2012-03-22 12:54:10 -04:00
Nick Mathewson
c41c1a2b80 Merge remote-tracking branch 'sebastian/clang_unknown_warning_options' into patches-2.0 2012-03-13 15:49:49 -04:00
Sebastian Hahn
c2c7b39d0d Properly zero the kevent in kq_setup_kevent()
Detected by clang
2012-03-13 08:33:06 +01:00
Sebastian Hahn
083296bc27 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.
2012-03-13 06:43:02 +01:00
Nick Mathewson
bec50680a3 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.
2012-02-15 20:25:31 -05:00
Mark Ellzey
2d67b63853 Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD 2012-02-14 15:37:58 -05:00
Mark Ellzey
9278196847 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).
2012-02-14 15:01:02 -05:00
Nick Mathewson
03dce42dfa 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.
2012-02-11 21:17:18 -05:00
Ross Lagerwall
d2b5f7223a 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.
2012-02-11 21:10:22 -05:00
Nick Mathewson
0c483170be Add an empty section to the changelog for 2.0.18-stable 2012-02-10 22:20:05 -05:00
Nick Mathewson
5a807b7aa2 Correct a name in the credits. oops 2012-02-10 22:17:59 -05:00
Nick Mathewson
2d7bf0f78d Bump version to 2.0.17-stable-dev 2012-02-10 22:16:14 -05:00
Nick Mathewson
83e58ccd30 Update the credits in the readme release-2.0.17-stable 2012-02-10 18:39:31 -05:00
Nick Mathewson
0cdbd642e3 Finalize the changelog 2012-02-10 18:36:10 -05:00
Nick Mathewson
e49e289129 Update copyright notices to 2012 2012-02-10 17:29:53 -05:00
Nick Mathewson
8152b4c2b3 Bump version to 2.0.17-stable 2012-02-10 16:49:05 -05:00
Nick Mathewson
5d7bfa1519 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.
2012-02-10 11:24:51 -05:00
Nick Mathewson
19715a60e2 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
2012-02-09 15:07:19 -05:00
Nick Mathewson
6f6cebe356 Bring the changelog up to date 2012-02-06 21:18:25 -05:00
Nick Mathewson
5b4b8126de 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.
2012-02-06 12:37:40 -05:00
Greg Hewgill
d84d917099 Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX). 2012-02-02 11:39:38 -05:00
Nick Mathewson
d6094b160f evdns: fix a bug in circular-queue implementation
found by Wang Qin
2012-02-01 14:56:43 -05:00
Nick Mathewson
9f9e259fda 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.
2012-01-26 15:04:24 -05:00
Nate R
c94a5f2a2c Do a memberwise comparison of threading function tables
Doing a memcmp risks comparing uninitialized padding bytes at the
end of the structure.
2012-01-24 17:15:50 -05:00
Nick Mathewson
438d4ff2bd Make event_base integrity check work on windows 2012-01-24 15:29:39 -05:00
Nick Mathewson
edc6d7d7fa Start writing a changelog for 2.0.17-stable 2012-01-24 15:09:04 -05:00
Nick Mathewson
5408ff3b89 Oops:remove an accidentally committed "sleep(1)" in a unit test 2012-01-24 11:16:26 -05:00
Nick Mathewson
dab91877bc Workaround in the unit tests for an apparent epoll bug in Linux 3.2 2012-01-24 11:04:19 -05:00
Nick Mathewson
3f18ad1b5f Fix a fd leak in event_reinit()
We were supposed to be closing the ev_signal_pair sockets.
2012-01-23 18:15:44 -05:00
Nick Mathewson
6e41cdc16b 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!
2012-01-23 17:59:16 -05:00
Nick Mathewson
3312b02036 Check event_base correctness at end of each unit test 2012-01-23 17:43:35 -05:00
Nick Mathewson
27737d55ae Add function to check referential integrity of an event_base 2012-01-21 12:55:15 -05:00
Catalin Patulea
790f6b3b10 Force strict validation of HTTP version in response.
This sometimes accepted invalid versions like 'ICY' (n = 0, major = undefined, sometimes > 1).
2012-01-20 11:37:38 -05:00