2324 Commits

Author SHA1 Message Date
vjpai
3c7d6fcaff Fix race caused by event_active
There is a race between manual event_active and natural event activation. If both happen at the same time on the same FD, they would both be protected by the same event base lock except for 1 LoC where the fields of struct event are read without any kind of lock. This commit does those reads into local variables inside the lock and then invokes the callback with those local arguments outside the lock. In 2.0-stable, none of this is inside the lock; in HEAD, only the callback is read inside the lock. This gets the callback and all 3 arguments inside the lock before calling it outside the lock.
2014-11-30 19:24:15 -05:00
ufo2243
b34e4ac3a4 [Bugfix] fix bufferevent setwatermark suspend_read 2014-09-18 15:07:41 -04:00
Maks Naumov
79800df7c7 regress_buffer: fix 'memcmp' compare size 2014-09-18 11:33:20 -04:00
Nick Mathewson
60f8f729d3 Consistently check for failure from evbuffer_pullup()
Closes issue #148.
2014-08-29 14:59:17 -04:00
Nick Mathewson
6466e88ac1 Use FindClose for handle from FindFirstFile in http-server.c
Noted by Miles Chan as issue #145
2014-08-29 14:31:07 -04:00
Pierre Phaneuf
1a8295a316 Add a few files created by "make verify" to .gitignore. 2014-08-18 10:13:52 -04:00
Nick Mathewson
e8fe749dba Fix a crash in evdns related to shutting down evdns
(Improved version to deal correctly with probe requests)

Patch from YASUOKA Masahiko; fix for libevent github issue #113.
2014-03-26 11:09:34 -04:00
Nick Mathewson
9f39c88756 Fix a crash in evdns related to shutting down evdns
Patch from YASUOKA Masahiko; fix for libevent github issue #113.
2014-03-21 14:08:17 -04:00
Trond Norbye
b56611d705 Add -Qunused-arguments for clang on macos
The clang compiler provided with macosx emits warnings like:

  CC       bufferevent.lo
clang: warning: argument unused during compilation: '-I .'
clang: warning: argument unused during compilation: '-I ./compat'
clang: warning: argument unused during compilation: '-I ./include'
clang: warning: argument unused during compilation: '-I ./include'

for each file being compiled. This generates a lot of noise during
compilation making it hard to see "real" errors. This patch mute
those warnings.
2014-03-03 11:05:41 -05:00
Nick Mathewson
f2428a284b bufferevent_pair: don't call downcast(NULL) 2014-02-09 13:29:26 -05:00
Marcin Juszkiewicz
dfe1e526f5 Check does arch have the epoll_create and __NR_epoll_wait syscalls.
Some architectures (like AArch64) do not have deprecated syscalls.

Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
2014-01-22 11:45:45 -05:00
Nick Mathewson
eaa79cd459 Merge remote-tracking branch 'sourceforge/patches-2.0' into patches-2.0
Conflicts:
	include/event2/event.h
2013-12-20 13:37:04 -05:00
Nick Mathewson
8cd695bf6d Typo fixes from Linus Nordberg 2013-12-20 13:35:03 -05:00
Nick Mathewson
cec62cb80a Typo fixes from Linus Nordberg 2013-12-20 13:31:29 -05:00
Nick Mathewson
031a803071 Clarify event_base_loop exit conditions 2013-12-16 12:02:21 -05:00
Nick Mathewson
f9284c3e3c update the 2.0 changelog 2013-12-05 17:14:05 -05:00
Nick Mathewson
3b77d62829 Avoid redundant invocations of init_extension_functions for IOCP 2013-11-01 14:20:25 -04:00
Nick Mathewson
e64a2b0b11 Fix another arc4random_buf-related warning 2013-09-19 10:48:09 -04:00
Nick Mathewson
5cb3865a40 Fix a compiler warning when checking for arc4random_buf linker breakage.
Patch by Ralph Castain.
2013-09-19 10:43:54 -04:00
Nate Rosenblum
5eb178855a Avoid racy bufferevent activation
The evhttp_send_reply method invokes evhttp_write_buffer with a
callback that may release the underlying request object and
bufferevent upon completion. This cleanup callback is invoked by the
underlying bufferevent's write callback. Improperly enabling write
events before referencing the bufferevent could lead to use after free
and memory corruption.
2013-09-09 11:59:00 -04:00
Nick Mathewson
c83efb801f Merge remote-tracking branch 'public/20_memclear' into patches-2.0 2013-08-19 10:02:55 -04:00
Nick Mathewson
f5ced88cec Really remove RNG seeds from the stack 2013-08-19 10:02:26 -04:00
Nick Mathewson
bb524712f6 Oops; revert testing code 2013-08-13 11:12:25 -04:00
Nick Mathewson
9695e9c192 Avoid other RNG initialization FS reads when urandom file is specified 2013-08-13 10:59:27 -04:00
Nick Mathewson
d44f91ad79 Finish a sentence 2013-08-13 10:59:20 -04:00
Nick Mathewson
2bbb5d7612 Add evutil_secure_rng_set_urandom_device_file
This experimental function is needed for some seccomp2 hackery to
work, and should have no effect for systems that don't use it.
2013-08-06 17:06:23 -04:00
Frank Denis
b8f59807ce libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) 2013-07-21 13:01:56 +02:00
Nick Mathewson
387e6b90c3 Merge remote-tracking branch 'public/pr/79' into patches-2.0 2013-06-10 15:16:13 -04:00
Nick Mathewson
6e49696147 Document that arc4random is not a great cryptographic PRNG. 2013-06-10 10:38:38 -04:00
Nick Mathewson
e35b540832 When we seed from /proc/sys/kernel/random/uuid, count it as success
Found by Joseph Spadavecchia
2013-06-10 10:33:56 -04:00
Greg Hazel
363388a043 restore the comment 2013-05-29 14:19:14 -07:00
Azat Khuzhin
f8d7df8591 Fix SEGFAULT after evdns_base_resume if no nameservers installed.
If there is no nameservers installed, using
evdns_base_nameserver_ip_add(), than evdns_base_resume() will SEGFAULT,
because of NULL dereference in evdns_requests_pump_waiting_queue()

Conflicts:
	evdns.c
2013-05-29 14:05:17 -07:00
Nick Mathewson
e826f19e05 Use windows vsnprintf fixup logic on all windows environments
Previously I'd relied on mingw to provide a vsnprintf with a
conformant return value.  But it appears that some mingw
environments don't do that.
2013-05-29 13:31:53 -04:00
Belobrov Andrey
5c710c0362 Checking request nameserver for NULL, before using it. 2013-05-07 10:01:36 -04:00
Nick Mathewson
959c1428cc Start a changelog for Libevent 2.0.22-stable 2013-04-30 11:42:53 -04:00
Nick Mathewson
66dacfa2a5 Merge remote-tracking branch 'origin/pr/36' into patches-2.0 2013-04-25 13:43:49 -04:00
Nick Mathewson
773b0a5d88 Fix a typo in a comment in buffer.h. Spotted by Alt_F4 2013-03-25 21:12:49 -04:00
Greg Hazel
b618204216 fix #73 and fix http_connection_fail_test to catch it 2013-02-14 09:54:56 -08:00
Nick Mathewson
a55514eeed Avoid using top_srcdir in TESTS-new automakes do not like this 2013-02-08 22:08:18 -05:00
Nick Mathewson
0c79787a97 Rename configure.in to configure.ac to appease newer autoconfs 2013-02-08 22:07:47 -05:00
Nick Mathewson
817ea36924 Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 compat
Patch from cazfi.
2013-02-08 13:03:29 -05:00
Nick Mathewson
0a5eb2eb5c Fix a locking error in bufferevent_socket_get_dns_error.
Patch from Ka-Hing Cheung.
2013-02-05 15:07:32 -05:00
Gyepi Sam
c322c2077e Fix a mistake in evbuffer_remove() arguments in example http server code
(commit message by nickm)
2013-01-22 16:59:07 +00:00
Kevin Bowling
74d4c44cf2 Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5)
This is a backport of ad03952.
2013-01-16 01:22:05 +08:00
Tay Ray Chuan
9ab2b3f749 Fix missing AC_PROG_SED on older Autoconfs
For pre-2.59b Autoconfs, AC_PROG_SED is not available [1]; on such
systems, avoid calling AC_PROG_SED, while providing a sensible SED.

This aids backporting to Autoconf 2.59.

[1] http://lists.gnu.org/archive/html/autotools-announce/2004-08/msg00002.html
2013-01-16 00:47:02 +08:00
Nick Mathewson
0a822a640e Avoid double-close on getsockname error in evutil_ersatz_socketpair
Found by coverity; CID 739726
2012-12-20 11:48:05 -05:00
Nick Mathewson
69db2610be Avoid leaking fds on evconnlistener with no callback set
There's no way to retrieve an fd from an evconnlistener whose
callback has been cleared, so we had better close any such fd.

Found by coverity; CID 739725.
2012-12-20 11:47:09 -05:00
Nick Mathewson
7e45739e26 Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled
Reported by Xiuqiang Jiang
2012-12-04 12:01:58 -05:00
Nick Mathewson
f7d92c6392 Increment version to 2.0.21-stable-dev 2012-11-19 10:56:16 -05:00
Nick Mathewson
6417777716 Increment libtool version for 2.0.21 too release-2.0.21-stable 2012-11-18 01:39:10 -05:00