]> granicus.if.org Git - libevent/log
libevent
9 years agoMerge pull request #212 from xbao/master
Nick Mathewson [Tue, 3 Feb 2015 20:57:31 +0000 (15:57 -0500)]
Merge pull request #212 from xbao/master

changed strtotimeval signature to avoid conflict with Android NDK sys/time.h header (#211)

9 years agoMerge remote-tracking branch 'public/master'
Nick Mathewson [Mon, 2 Feb 2015 18:57:50 +0000 (13:57 -0500)]
Merge remote-tracking branch 'public/master'

9 years agoNew function to get address for nameserver.
Nick Mathewson [Mon, 2 Feb 2015 18:57:22 +0000 (13:57 -0500)]
New function to get address for nameserver.

9 years agochanged strtotimeval signature as per #211
Xiao Bao Clark [Wed, 28 Jan 2015 06:17:02 +0000 (17:17 +1100)]
changed strtotimeval signature as per #211

9 years agoMerge pull request #210 from mc-server/master
Nick Mathewson [Tue, 27 Jan 2015 15:07:22 +0000 (10:07 -0500)]
Merge pull request #210 from mc-server/master

Added cmake-generated files to ignore list.

9 years agoAdded cmake-generated files to ignore list.
Matyas Dolak [Tue, 27 Jan 2015 14:30:52 +0000 (15:30 +0100)]
Added cmake-generated files to ignore list.

These are generated by cmake on Windows with MSVC.

9 years agoMerge pull request #115 from jer-gentoo/master
Nick Mathewson [Thu, 22 Jan 2015 17:15:01 +0000 (12:15 -0500)]
Merge pull request #115 from jer-gentoo/master

EVBUFFER_PTR_SET -> EVBUFFER_PTR_ADD

9 years agoEVBUFFER_PTR_SET -> EVBUFFER_PTR_ADD
jer-gentoo [Wed, 21 Jan 2015 10:24:23 +0000 (11:24 +0100)]
EVBUFFER_PTR_SET -> EVBUFFER_PTR_ADD

Looks like EVBUFFER_PTR_ADD should have been used instead of EVBUFFER_PTR_SET.

9 years agoUpdate changelog release-2.1.5-beta
Nick Mathewson [Mon, 5 Jan 2015 14:33:48 +0000 (09:33 -0500)]
Update changelog

9 years agoMerge branch '21_cve_2014_6272_v2'
Nick Mathewson [Mon, 5 Jan 2015 14:33:02 +0000 (09:33 -0500)]
Merge branch '21_cve_2014_6272_v2'

9 years agoFix CVE-2014-6272 in Libevent 2.1
Nick Mathewson [Mon, 5 Jan 2015 14:32:53 +0000 (09:32 -0500)]
Fix CVE-2014-6272 in Libevent 2.1

For this fix, we need to make sure that passing too-large inputs to
the evbuffer functions can't make us do bad things with the heap.

Also, lower the maximum chunk size to the lower of off_t, size_t maximum.

This is necessary since otherwise we could get into an infinite loop
if we make a chunk that 'misalign' cannot index into.

9 years agoIncrement version to 2.1.5-beta
Nick Mathewson [Mon, 5 Jan 2015 14:16:12 +0000 (09:16 -0500)]
Increment version to 2.1.5-beta

9 years agowork on changelog for 2.1.5-alpah
Nick Mathewson [Mon, 5 Jan 2015 13:50:30 +0000 (08:50 -0500)]
work on changelog for 2.1.5-alpah

9 years agoMerge pull request #201 from nsuke/cmake-shared-build
Nick Mathewson [Sun, 4 Jan 2015 15:27:02 +0000 (10:27 -0500)]
Merge pull request #201 from nsuke/cmake-shared-build

Fix CMake shared library build

9 years agoFix CMake shared library build
Nobuaki Sukegawa [Fri, 2 Jan 2015 17:22:31 +0000 (02:22 +0900)]
Fix CMake shared library build

This fixes following problems in shared library build:
* visibility=hidden was not enabled for gcc because of incorrect variable name
* test programs that need internal APIs caused link errors

10 years agoMerge pull request #197 from JohnOhl/fix-clang-compile-warnings
Nick Mathewson [Tue, 23 Dec 2014 14:35:40 +0000 (09:35 -0500)]
Merge pull request #197 from JohnOhl/fix-clang-compile-warnings

Fix warnings when compiling with clang 3.5

10 years agoFix warnings when compiling with clang 3.5
John Ohl [Mon, 22 Dec 2014 05:46:56 +0000 (00:46 -0500)]
Fix warnings when compiling with clang 3.5

10 years agoFix annoying heisenbug in test-time.c
Nick Mathewson [Mon, 15 Dec 2014 17:50:11 +0000 (12:50 -0500)]
Fix annoying heisenbug in test-time.c

10 years agoMerge pull request #192 from miniupnp/master
Nick Mathewson [Mon, 8 Dec 2014 15:26:01 +0000 (10:26 -0500)]
Merge pull request #192 from miniupnp/master

Fix mixed declarations and code (forbidden by ISO C90)

10 years agoFix mixed declarations and code (forbidden by ISO C90)
Thomas Bernard [Mon, 8 Dec 2014 09:21:00 +0000 (10:21 +0100)]
Fix mixed declarations and code (forbidden by ISO C90)

10 years agoImplement new/free for struct evutil_monotonic_timer and export monotonic time functions
Andrea Shepard [Wed, 19 Nov 2014 12:18:05 +0000 (12:18 +0000)]
Implement new/free for struct evutil_monotonic_timer and export monotonic time functions

10 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Mon, 1 Dec 2014 13:32:23 +0000 (08:32 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

10 years agoFix evbuffer_peek() with len==-1 and start_at non-NULL.
Nick Mathewson [Sun, 30 Nov 2014 16:05:40 +0000 (11:05 -0500)]
Fix evbuffer_peek() with len==-1 and start_at non-NULL.

10 years agoMerge remote-tracking branch 'public/patches-2.0'
Nick Mathewson [Mon, 1 Dec 2014 02:07:55 +0000 (21:07 -0500)]
Merge remote-tracking branch 'public/patches-2.0'

Conflicts:
ChangeLog
event.c

10 years agoMerge branch 'patches-2.0' of github.com:libevent/libevent into patches-2.0
Nick Mathewson [Mon, 1 Dec 2014 02:02:25 +0000 (21:02 -0500)]
Merge branch 'patches-2.0' of github.com:libevent/libevent into patches-2.0

10 years agoStart on 2.1.5-alpha/beta changelog
Nick Mathewson [Mon, 1 Dec 2014 02:02:06 +0000 (21:02 -0500)]
Start on 2.1.5-alpha/beta changelog

10 years agoWork on the changelog for 2.0.22
Nick Mathewson [Mon, 1 Dec 2014 00:38:23 +0000 (19:38 -0500)]
Work on the changelog for 2.0.22

10 years agoMerge remote-tracking branch 'origin/pr/182'
Nick Mathewson [Mon, 1 Dec 2014 00:26:20 +0000 (19:26 -0500)]
Merge remote-tracking branch 'origin/pr/182'

10 years agoMerge remote-tracking branch 'origin/pr/180'
Nick Mathewson [Mon, 1 Dec 2014 00:25:21 +0000 (19:25 -0500)]
Merge remote-tracking branch 'origin/pr/180'

10 years agoFix race caused by event_active
vjpai [Mon, 22 Sep 2014 19:19:37 +0000 (12:19 -0700)]
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.

10 years agoMerge remote-tracking branch 'origin/pr/175'
Nick Mathewson [Sun, 30 Nov 2014 16:11:33 +0000 (11:11 -0500)]
Merge remote-tracking branch 'origin/pr/175'

10 years agoMerge branch 'evbufer_peek_fix_v3'
Nick Mathewson [Sun, 30 Nov 2014 16:09:50 +0000 (11:09 -0500)]
Merge branch 'evbufer_peek_fix_v3'

10 years agoMore evbuffer_peek() test cases
Nick Mathewson [Sun, 30 Nov 2014 16:09:28 +0000 (11:09 -0500)]
More evbuffer_peek() test cases

10 years agotest/evbuffer_peek: add regress in case we have first buffer greater
Azat Khuzhin [Tue, 11 Nov 2014 11:25:47 +0000 (14:25 +0300)]
test/evbuffer_peek: add regress in case we have first buffer greater

10 years agoFix evbuffer_peek() with len==-1 and start_at non-NULL.
Nick Mathewson [Sun, 30 Nov 2014 16:05:40 +0000 (11:05 -0500)]
Fix evbuffer_peek() with len==-1 and start_at non-NULL.

10 years agoMerge remote-tracking branch 'origin/pr/186'
Nick Mathewson [Sun, 30 Nov 2014 15:23:39 +0000 (10:23 -0500)]
Merge remote-tracking branch 'origin/pr/186'

10 years agoFix cmake error when the Module path has more than one entry.
Acer Yang [Sat, 20 Sep 2014 07:25:53 +0000 (15:25 +0800)]
Fix cmake error when the Module path has more than one entry.

CMAKE_MODULE_PATH is usually a list instead of single entry. Especially
for projects contain sub cmake projects. My patch replace the
CMAKE_MODULE_PATH with fixed path, to locate the `.in` file.

10 years agoMerge pull request #189 from azat/be_async-avoid-doule-close
Nick Mathewson [Mon, 24 Nov 2014 06:09:13 +0000 (01:09 -0500)]
Merge pull request #189 from azat/be_async-avoid-doule-close

be async: avoid double close()

10 years agobe async: avoid double close()
Azat Khuzhin [Fri, 21 Nov 2014 06:00:12 +0000 (09:00 +0300)]
be async: avoid double close()

In case when between this two close (close(F), close(F)) some open()
will be executed, than we will close newly opened fd.

Reported-by: xujiezhige@163.com
10 years agoPrevent duplicate event_del on fd
John Ohl [Mon, 17 Nov 2014 04:40:16 +0000 (23:40 -0500)]
Prevent duplicate event_del on fd

10 years agoevdns: avoid read-after-free in evdns_request_timeout_callback()
Azat Khuzhin [Wed, 12 Nov 2014 17:16:18 +0000 (20:16 +0300)]
evdns: avoid read-after-free in evdns_request_timeout_callback()

In evdns_request_timeout_callback() in case we a giving up, we call
request_finished() which will free() req structure, however we ns from
it to fail it, so save pointer to ns to call nameserver_failed() on
them.

Founded with valgrind:
$ valgrind regress dns/retry
==10497== Memcheck, a memory error detector
==10497== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==10497== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==10497== Command: regress dns/retry
==10497==
dns/retry: [forking] ==10498== Invalid read of size 8
==10498==    at 0x4C309D: evdns_request_timeout_callback (evdns.c:2179)
==10498==    by 0x49EA95: event_process_active_single_queue (event.c:1576)
==10498==    by 0x49EFDD: event_process_active (event.c:1668)
==10498==    by 0x49F6DD: event_base_loop (event.c:1891)
==10498==    by 0x49F063: event_base_dispatch (event.c:1702)
==10498==    by 0x44C7F1: dns_retry_test_impl (regress_dns.c:724)
==10498==    by 0x44CF60: dns_retry_test (regress_dns.c:749)
==10498==    by 0x48A8A1: testcase_run_bare_ (tinytest.c:105)
==10498==    by 0x48A94E: testcase_run_forked_ (tinytest.c:189)
==10498==    by 0x48AB73: testcase_run_one (tinytest.c:247)
==10498==    by 0x48B4C2: tinytest_main (tinytest.c:434)
==10498==    by 0x477FC7: main (regress_main.c:459)
==10498==  Address 0x6176ef8 is 40 bytes inside a block of size 342 free'd
==10498==    at 0x4C29E90: free (vg_replace_malloc.c:473)
==10498==    by 0x4A4411: event_mm_free_ (event.c:3443)
==10498==    by 0x4BE8C5: request_finished (evdns.c:702)
==10498==    by 0x4C3098: evdns_request_timeout_callback (evdns.c:2178)
==10498==    by 0x49EA95: event_process_active_single_queue (event.c:1576)
==10498==    by 0x49EFDD: event_process_active (event.c:1668)
==10498==    by 0x49F6DD: event_base_loop (event.c:1891)
==10498==    by 0x49F063: event_base_dispatch (event.c:1702)
==10498==    by 0x44C7F1: dns_retry_test_impl (regress_dns.c:724)
==10498==    by 0x44CF60: dns_retry_test (regress_dns.c:749)
==10498==    by 0x48A8A1: testcase_run_bare_ (tinytest.c:105)
==10498==    by 0x48A94E: testcase_run_forked_ (tinytest.c:189)
==10498==
==10498==
==10498== HEAP SUMMARY:
==10498==     in use at exit: 0 bytes in 0 blocks
==10498==   total heap usage: 83 allocs, 83 frees, 10,020 bytes allocated
==10498==
==10498== All heap blocks were freed -- no leaks are possible
==10498==
==10498== For counts of detected and suppressed errors, rerun with: -v
==10498== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
OK
1 tests ok.  (0 skipped)
==10497==
==10497== HEAP SUMMARY:
==10497==     in use at exit: 0 bytes in 0 blocks
==10497==   total heap usage: 3 allocs, 3 frees, 96 bytes allocated
==10497==
==10497== All heap blocks were freed -- no leaks are possible
==10497==
==10497== For counts of detected and suppressed errors, rerun with: -v
==10497== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Bug was introduced in 97c750d6602517f22a1100f16592b421c38f2a45 ("evdns:
fail ns after we are failing/retrasmitting request").

10 years agoAdd test for evhttp_connection_free_on_completion
John Ohl [Wed, 29 Oct 2014 07:40:44 +0000 (03:40 -0400)]
Add test for evhttp_connection_free_on_completion

10 years agoImplement interface that provides the ability to have an outbound evhttp_connection...
John Ohl [Sun, 26 Oct 2014 05:18:10 +0000 (01:18 -0400)]
Implement interface that provides the ability to have an outbound evhttp_connection free itself once all requests have completed

10 years agoremove trailing comma from enum
Jean-Philippe Ouellet [Fri, 17 Oct 2014 02:56:49 +0000 (22:56 -0400)]
remove trailing comma from enum

makes being included from something with -std=c89 happy

10 years agoMerge pull request #179 from pysiak/master
Nick Mathewson [Mon, 13 Oct 2014 21:59:32 +0000 (17:59 -0400)]
Merge pull request #179 from pysiak/master

Provide support for SO_REUSEPORT through LEV_OPT_REUSABLE_PORT

10 years agoProvide support for SO_REUSEPORT through LEV_OPT_REUSABLE_PORT
Maciej Soltysiak [Mon, 13 Oct 2014 15:28:14 +0000 (17:28 +0200)]
Provide support for SO_REUSEPORT through LEV_OPT_REUSABLE_PORT

10 years agoMerge pull request #174 from azat/dns-fail-disable-when-inactive-fix-v3
Nick Mathewson [Thu, 9 Oct 2014 15:48:38 +0000 (11:48 -0400)]
Merge pull request #174 from azat/dns-fail-disable-when-inactive-fix-v3

Dns fail disable when inactive fix v3

10 years agoMerge pull request #171 from azat/bufferevent-openssl-fixes-v4
Nick Mathewson [Thu, 9 Oct 2014 15:30:01 +0000 (11:30 -0400)]
Merge pull request #171 from azat/bufferevent-openssl-fixes-v4

bufferevent_openssl: reset fd_is_set when setfd with -1 is called

10 years agoMerge pull request #170 from azat/https-client-retries
Nick Mathewson [Thu, 9 Oct 2014 15:29:17 +0000 (11:29 -0400)]
Merge pull request #170 from azat/https-client-retries

https-client: add -retries argument, for connection retries

10 years agoMerge pull request #108 from JoakimSoderberg/minor_issues
Nick Mathewson [Thu, 9 Oct 2014 14:42:20 +0000 (10:42 -0400)]
Merge pull request #108 from JoakimSoderberg/minor_issues

Fix compilation for older OpenSSL versions.

10 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Thu, 9 Oct 2014 14:14:30 +0000 (10:14 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

10 years agoFix a typo in a doxygen comment. Reported by 亦得.
Nick Mathewson [Thu, 9 Oct 2014 14:14:12 +0000 (10:14 -0400)]
Fix a typo in a doxygen comment. Reported by äº¦å¾—.

10 years agohttp: reset connection before installing retry timer (fix http retries handling)
Azat Khuzhin [Sat, 27 Sep 2014 17:29:45 +0000 (21:29 +0400)]
http: reset connection before installing retry timer (fix http retries handling)

This will fix some invalid read/write:
==556== Invalid read of size 8
==556==    at 0x4E4EEC6: event_queue_remove_timeout (minheap-internal.h:178)
==556==    by 0x4E508AA: event_del_nolock_ (event.c:2764)
==556==    by 0x4E53535: event_base_loop (event.c:3088)
==556==    by 0x406FCFA: dispatch (libcrawl.c:271)
==556==    by 0x402863: main (crawler.c:49)
==556==  Address 0x68a3f18 is 152 bytes inside a block of size 400 free'd
==556==    at 0x4C29C97: free (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==556==    by 0x406F140: renew (libcrawl.c:625)
==556==    by 0x4E6CDE9: evhttp_connection_cb_cleanup (http.c:1331)
==556==    by 0x4E6E2B2: evhttp_connection_cb (http.c:1424)
==556==    by 0x4E4DF2D: bufferevent_writecb (bufferevent_sock.c:310)
==556==    by 0x4E52D1D: event_process_active_single_queue (event.c:1584)
==556==    by 0x4E53676: event_base_loop (event.c:1676)
==556==    by 0x406FCFA: dispatch (libcrawl.c:271)
==556==    by 0x402863: main (crawler.c:49)
But this one because of some invalid write before (I guess).

It is 100% reproduced during massive crawling (because this process
has many different servers), but after spending some time for trying to
reproduce this using some simple tests/utils I gave up for a few days (I
have a lot of work to do), but I'm sending this patch as a reminder.

Just in case, I've tried next tests:
- mixing timeouts/retries
- shutdown http server and return it back
- slow dns server for first request
- sleep before accept
- hacking libevent sources to change the behaviour of http layer (so it
  will go into that function which I'm insterested in).

10 years agoevdns: fail ns after we are failing/retrasmitting request
Azat Khuzhin [Mon, 29 Sep 2014 21:34:04 +0000 (01:34 +0400)]
evdns: fail ns after we are failing/retrasmitting request

In case we are failing request (evdns_request_timeout_callback()), we
delete timeout_event in request_finished(), while just before calling
request_finished() (for failing request) there was a call to
nameserver_failed(), that add event for timeout_event, IOW we must fail
ns after request because otherwise we will not have timeout_event
actived, and we will waiting forever.

Before this patch the dns/retry_disable_when_inactive will wait forever,
after - OK.

10 years agoevdns: add retry/reissue tests for EVDNS_BASE_DISABLE_WHEN_INACTIVE
Azat Khuzhin [Thu, 10 Apr 2014 15:33:45 +0000 (19:33 +0400)]
evdns: add retry/reissue tests for EVDNS_BASE_DISABLE_WHEN_INACTIVE

10 years agoevdns: fix EVDNS_BASE_DISABLE_WHEN_INACTIVE in case retransmit/retry
Azat Khuzhin [Thu, 10 Apr 2014 15:30:47 +0000 (19:30 +0400)]
evdns: fix EVDNS_BASE_DISABLE_WHEN_INACTIVE in case retransmit/retry

10 years agoFix compilation for older OpenSSL versions.
Joakim Soderberg [Wed, 24 Sep 2014 11:46:09 +0000 (13:46 +0200)]
Fix compilation for older OpenSSL versions.

For instance OpenSSL 0.9.7 does not have SSL_set_tlsext_host_name.

Also add the missing EVENT__DISABLE_SAMPLES CMake option.

10 years agobufferevent_openssl: reset fd_is_set when setfd with -1 is called
Azat Khuzhin [Sun, 21 Sep 2014 14:29:17 +0000 (18:29 +0400)]
bufferevent_openssl: reset fd_is_set when setfd with -1 is called

Otherwise we will use old fd after close(2) called on it:
(Traces trimmed, to minimize it)
$ strace -keclose,open,socket,epoll_ctl https-client -url https://libevent.org
socket(PF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_IP) = 5
 > /lib/x86_64-linux-gnu/libc-2.19.so(socket+0x7) [0xe6da7]
 > /usr/lib/libevent-2.1.so.4.0.0(evutil_socket_+0x25) [0x27835]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_socket_connect+0xe9) [0x1b1a9]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_socket_connect+0x21f) [0x1b2df]
 > /usr/lib/libevent-2.1.so.4.0.0(evutil_getaddrinfo_async_+0x65) [0x271a5]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_socket_connect_hostname+0x106) [0x1b416]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_connect_+0xe7) [0x39f07]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_make_request+0xb8) [0x3a218]
epoll_ctl(3, EPOLL_CTL_ADD, 5, {EPOLLIN, {u32=5, u64=5}}) = 0
 > ...
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xfdd) [0x2ced]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_setfd+0x3b) [0x16d9b]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_socket_connect+0x75) [0x1b135]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_socket_connect+0x21f) [0x1b2df]
 > /usr/lib/libevent-2.1.so.4.0.0(evutil_getaddrinfo_async_+0x65) [0x271a5]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_socket_connect_hostname+0x106) [0x1b416]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_connect_+0xe7) [0x39f07]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_make_request+0xb8) [0x3a218]
epoll_ctl(3, EPOLL_CTL_MOD, 5, {EPOLLIN|EPOLLOUT, {u32=5, u64=5}}) = 0
 > ...
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xfee) [0x2cfe]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_setfd+0x3b) [0x16d9b]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_socket_connect+0x75) [0x1b135]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_socket_connect+0x21f) [0x1b2df]
 > /usr/lib/libevent-2.1.so.4.0.0(evutil_getaddrinfo_async_+0x65) [0x271a5]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_socket_connect_hostname+0x106) [0x1b416]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_connect_+0xe7) [0x39f07]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_make_request+0xb8) [0x3a218]
epoll_ctl(3, EPOLL_CTL_MOD, 5, {EPOLLOUT, {u32=5, u64=5}}) = 0
 > ...
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xbbc) [0x28cc]
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xd96) [0x2aa6]
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xeb8) [0x2bc8]
 > /usr/lib/libevent-2.1.so.4.0.0(event_free+0x3fe) [0x1fd1e]
 > /usr/lib/libevent-2.1.so.4.0.0(event_base_loop+0x407) [0x20677]
epoll_ctl(3, EPOLL_CTL_DEL, 5, 7fffa1f841e0) = 0
 > ...
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xbc4) [0x28d4]
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xd96) [0x2aa6]
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xeb8) [0x2bc8]
 > /usr/lib/libevent-2.1.so.4.0.0(event_free+0x3fe) [0x1fd1e]
 > /usr/lib/libevent-2.1.so.4.0.0(event_base_loop+0x407) [0x20677]
close(5)                                = 0
 > /lib/x86_64-linux-gnu/libpthread-2.19.so(__close_nocancel+0x7) [0xeb20]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_reset_+0x55) [0x373f5]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_connect_+0x1d) [0x39e3d]
 > /usr/lib/libevent-2.1.so.4.0.0(event_free+0x3fe) [0x1fd1e]
 > /usr/lib/libevent-2.1.so.4.0.0(event_base_loop+0x407) [0x20677]
epoll_ctl(3, EPOLL_CTL_ADD, 5, {EPOLLIN, {u32=5, u64=5}}) = -1 EBADF (Bad file descriptor)
) = -1 EBADF (Bad file descriptor)
/src/oss/strace-code/strace: Can't initiate libunwind: No such process
 > ...
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xfdd) [0x2ced]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_setfd+0x3b) [0x16d9b]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_connect_+0x14c) [0x39f6c]
 > /usr/lib/libevent-2.1.so.4.0.0(event_free+0x3fe) [0x1fd1e]
 > /usr/lib/libevent-2.1.so.4.0.0(event_base_loop+0x407) [0x20677]
/src/oss/strace-code/strace: Exit of unknown pid 28185 seen
[warn] Epoll ADD(1) on fd 5 failed.  Old events were 0; read change was 1 (add); write change was 0 (none); close change was 0 (none): Bad file descriptor
epoll_ctl(3, EPOLL_CTL_ADD, 5, {EPOLLOUT, {u32=5, u64=5}}) = -1 EBADF (Bad file descriptor)
) = -1 EBADF (Bad file descriptor)
/src/oss/strace-code/strace: Can't initiate libunwind: No such process
 > ...
 > /usr/lib/libevent_openssl-2.1.so.4.0.0(_init+0xfee) [0x2cfe]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_setfd+0x3b) [0x16d9b]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_connect_+0x14c) [0x39f6c]
 > /usr/lib/libevent-2.1.so.4.0.0(event_free+0x3fe) [0x1fd1e]
 > /usr/lib/libevent-2.1.so.4.0.0(event_base_loop+0x407) [0x20677]
/src/oss/strace-code/strace: Exit of unknown pid 28186 seen
[warn] Epoll ADD(4) on fd 5 failed.  Old events were 0; read change was 0 (none); write change was 1 (add); close change was 0 (none): Bad file descriptor
<getaddrinfo traces trimmed>
close(5)                                = -1 EBADF (Bad file descriptor)
)                                = -1 EBADF (Bad file descriptor)
/src/oss/strace-code/strace: Can't initiate libunwind: No such process
 > /lib/x86_64-linux-gnu/libpthread-2.19.so(__close_nocancel+0x7) [0xeb20]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_reset_+0x55) [0x373f5]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_fail_+0xc1) [0x3aed1]
 > /usr/lib/libevent-2.1.so.4.0.0(evhttp_connection_fail_+0x4a3) [0x3b2b3]
 > /usr/lib/libevent-2.1.so.4.0.0(bufferevent_enable+0x192) [0x16722]
 > /usr/lib/libevent-2.1.so.4.0.0(event_free+0x5df) [0x1feff]
 > /usr/lib/libevent-2.1.so.4.0.0(event_base_loop+0x407) [0x20677]
/src/oss/strace-code/strace: Exit of unknown pid 28187 seen
some request failed - no idea which one though!
socket error = Bad file descriptor (9)

Before this patch:
$ sample/https-client -retries 1 -url https://libevent.org
[warn] Epoll ADD(1) on fd 6 failed.  Old events were 0; read change was 1 (add); write change was 0 (none); close change was 0 (none): Bad file descriptor
[warn] Epoll ADD(4) on fd 6 failed.  Old events were 0; read change was 0 (none); write change was 1 (add); close change was 0 (none): Bad file descriptor
some request failed - no idea which one though!
socket error = Bad file descriptor (9)

After this patch:
$ sample/https-client -retries 1 -url https://libevent.org
Response line: 0 (null)

Reported-by: gerkenjohannes@web.de
10 years agohttps-client: add -retries argument, for connection retries
Azat Khuzhin [Sun, 21 Sep 2014 14:36:29 +0000 (18:36 +0400)]
https-client: add -retries argument, for connection retries

Using evhttp_connection_set_retries() API.

10 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Thu, 18 Sep 2014 19:08:57 +0000 (15:08 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

10 years ago[Bugfix] fix bufferevent setwatermark suspend_read
ufo2243 [Fri, 12 Sep 2014 06:19:14 +0000 (14:19 +0800)]
[Bugfix] fix bufferevent setwatermark suspend_read

10 years agoFix several memory leaks in the unit tests.
Nick Mathewson [Thu, 18 Sep 2014 16:40:38 +0000 (12:40 -0400)]
Fix several memory leaks in the unit tests.

Also add a comment to buffer.c about why we call
evbuffer_file_segment_free on failure to add the segment.

10 years agoFix for a677b72bd6d9d378daf9775966aa8ca574e26e67
Nick Mathewson [Thu, 18 Sep 2014 16:12:36 +0000 (12:12 -0400)]
Fix for a677b72bd6d9d378daf9775966aa8ca574e26e67

10 years agoMake a buffer larger in the tests to avoid a scary evbuffer_copyout_from()
Nick Mathewson [Thu, 18 Sep 2014 16:08:50 +0000 (12:08 -0400)]
Make a buffer larger in the tests to avoid a scary evbuffer_copyout_from()

The call was safe, but coverity couldn't tell. CID 1239294.

10 years agoUse a more precise calculation for max in time-ratelim.c
Nick Mathewson [Thu, 18 Sep 2014 16:04:16 +0000 (12:04 -0400)]
Use a more precise calculation for max in time-ratelim.c

CID 1239297

10 years agoUse evutil_weakrand() in unit tests.
Nick Mathewson [Thu, 18 Sep 2014 16:02:13 +0000 (12:02 -0400)]
Use evutil_weakrand() in unit tests.

(Coverity doesn't like random() or rand().  We don't care; this is
for unit tests.)

Fixes CID 1239298123929612392951239293.

10 years agoFix a c90 warning
Nick Mathewson [Thu, 18 Sep 2014 15:54:39 +0000 (11:54 -0400)]
Fix a c90 warning

10 years agoFix a dead-code warning in unit tests. CID 1193548
Nick Mathewson [Thu, 18 Sep 2014 15:54:04 +0000 (11:54 -0400)]
Fix a dead-code warning in unit tests. CID 1193548

10 years agoFix a use-after-free in unit tests. CID 752027
Nick Mathewson [Thu, 18 Sep 2014 15:52:16 +0000 (11:52 -0400)]
Fix a use-after-free in unit tests. CID 752027

10 years agoMerge pull request #168 from ufo2243/master
Nick Mathewson [Thu, 18 Sep 2014 15:44:11 +0000 (11:44 -0400)]
Merge pull request #168 from ufo2243/master

make bufferevent_getwatermark api more robust

10 years agoMerge pull request #119 from ldx/winhosts
Nick Mathewson [Thu, 18 Sep 2014 15:41:18 +0000 (11:41 -0400)]
Merge pull request #119 from ldx/winhosts

Fix hosts file use on Windows.

10 years agoFix use-after-free error in EV_CLOSURE_EVENT callback
John Ohl [Wed, 17 Sep 2014 02:25:52 +0000 (22:25 -0400)]
Fix use-after-free error in EV_CLOSURE_EVENT callback

10 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Thu, 18 Sep 2014 15:36:08 +0000 (11:36 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

10 years agoregress_buffer: fix 'memcmp' compare size
Maks Naumov [Tue, 25 Mar 2014 11:35:13 +0000 (13:35 +0200)]
regress_buffer: fix 'memcmp' compare size

10 years agoMerge pull request #118 from azat/http-forward-family-to-bufferevent
Nick Mathewson [Thu, 18 Sep 2014 15:31:52 +0000 (11:31 -0400)]
Merge pull request #118 from azat/http-forward-family-to-bufferevent

Add evhttp_connection_set_family() to set addrinfo->family for DNS requests

10 years agouse correct tt macro for pointer compare
Nick Mathewson [Thu, 18 Sep 2014 15:28:19 +0000 (11:28 -0400)]
use correct tt macro for pointer compare

10 years agoMerge pull request #128 from azat/tests-disable-when-inactive-v5
Nick Mathewson [Thu, 18 Sep 2014 15:25:27 +0000 (11:25 -0400)]
Merge pull request #128 from azat/tests-disable-when-inactive-v5

Some tests for EVDNS_BASE_DISABLE_WHEN_INACTIVE flag

10 years agoMerge pull request #129 from azat/disable-probing-with-disable-when-inactive-v2
Nick Mathewson [Thu, 18 Sep 2014 15:24:56 +0000 (11:24 -0400)]
Merge pull request #129 from azat/disable-probing-with-disable-when-inactive-v2

evdns: disable probing with EVDNS_BASE_DISABLE_WHEN_INACTIVE

10 years agomake bufferevent_getwatermark api more robust
ufo2243 [Fri, 12 Sep 2014 03:51:59 +0000 (11:51 +0800)]
make bufferevent_getwatermark api more robust

10 years agoMerge pull request #167 from snikulov/pr_libevent_cmake_upd
Nick Mathewson [Mon, 8 Sep 2014 19:37:31 +0000 (15:37 -0400)]
Merge pull request #167 from snikulov/pr_libevent_cmake_upd

updates in cmake build

10 years agoMerge pull request #103 from ufo2243/master
Nick Mathewson [Wed, 3 Sep 2014 13:29:59 +0000 (09:29 -0400)]
Merge pull request #103 from ufo2243/master

[Bugfix] fix grammer error

10 years ago[Bugfix] fix grammer error
ufo2243 [Wed, 3 Sep 2014 02:55:27 +0000 (10:55 +0800)]
[Bugfix] fix grammer error

10 years agoupdates in cmake build
Sergey Nikulov [Tue, 2 Sep 2014 14:25:52 +0000 (18:25 +0400)]
updates in cmake build

10 years agoCorrectly handle allocation failures in evdns_getaddrinfo
Nick Mathewson [Fri, 29 Aug 2014 19:26:56 +0000 (15:26 -0400)]
Correctly handle allocation failures in evdns_getaddrinfo

Kuldeep Gupta appears to have used some kind of automated tool to
find this and generate a patch for half the issue as #149.

10 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Fri, 29 Aug 2014 19:00:33 +0000 (15:00 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

10 years agoConsistently check for failure from evbuffer_pullup()
Nick Mathewson [Fri, 29 Aug 2014 18:59:17 +0000 (14:59 -0400)]
Consistently check for failure from evbuffer_pullup()

Closes issue #148.

10 years agoMerge pull request #153 from azat/tests-simplestsignal
Nick Mathewson [Fri, 29 Aug 2014 18:38:09 +0000 (14:38 -0400)]
Merge pull request #153 from azat/tests-simplestsignal

test/regress: add simplestsignal: to track reorder bugs separately

10 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Fri, 29 Aug 2014 18:32:10 +0000 (14:32 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

Conflicts:
sample/http-server.c

10 years agoUse FindClose for handle from FindFirstFile in http-server.c
Nick Mathewson [Fri, 29 Aug 2014 18:31:07 +0000 (14:31 -0400)]
Use FindClose for handle from FindFirstFile in http-server.c

Noted by Miles Chan as issue #145

10 years agoChange return type of evutil_load_windows_system_library_ to HMODULE
Nick Mathewson [Fri, 29 Aug 2014 18:28:09 +0000 (14:28 -0400)]
Change return type of evutil_load_windows_system_library_ to HMODULE

Noted by Miles Chan as issue #146

10 years agoFix issue #127, double free for filterevents that use BEV_OPT_CLOSE_ON_FREE
John Ohl [Wed, 30 Apr 2014 17:55:49 +0000 (13:55 -0400)]
Fix issue #127, double free for filterevents that use BEV_OPT_CLOSE_ON_FREE

10 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Mon, 18 Aug 2014 14:14:29 +0000 (10:14 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

10 years agoAdd a few files created by "make verify" to .gitignore.
Pierre Phaneuf [Wed, 13 Aug 2014 22:17:52 +0000 (23:17 +0100)]
Add a few files created by "make verify" to .gitignore.

10 years agotest/regress: add simplestsignal: to track reorder bugs separately
Azat Khuzhin [Sat, 22 Feb 2014 22:31:51 +0000 (02:31 +0400)]
test/regress: add simplestsignal: to track reorder bugs separately

10 years agoMerge pull request #140 from vapier/ignore
Nick Mathewson [Sun, 15 Jun 2014 03:44:47 +0000 (23:44 -0400)]
Merge pull request #140 from vapier/ignore

ignore config.cache/test-driver files

10 years agoMerge pull request #143 from vapier/disable-sample
Nick Mathewson [Sun, 15 Jun 2014 03:44:18 +0000 (23:44 -0400)]
Merge pull request #143 from vapier/disable-sample

add a --disable-samples configure flag

10 years agoadd a --disable-samples configure flag
Mike Frysinger [Fri, 13 Jun 2014 21:07:50 +0000 (17:07 -0400)]
add a --disable-samples configure flag

For people building & installing libevent in a distro, building all these
sample apps are not useful.  Add a flag to turn them off.

10 years agoignore config.cache/test-driver files
Mike Frysinger [Fri, 13 Jun 2014 18:18:13 +0000 (14:18 -0400)]
ignore config.cache/test-driver files

config.cache is generated when you run `./configure -C`.

test-driver comes from newer autotools.

10 years agoHandle ENOTCAPABLE from FreeBSD - this is returned if an event in the
Adrian Chadd [Sat, 7 Jun 2014 19:57:02 +0000 (12:57 -0700)]
Handle ENOTCAPABLE from FreeBSD - this is returned if an event in the
changelist is for an FD that has been closed.

10 years agoMake http-server.c output into good html5
Nick Mathewson [Fri, 30 May 2014 17:53:27 +0000 (13:53 -0400)]
Make http-server.c output into good html5