]> granicus.if.org Git - libevent/log
libevent
9 years agoMerge pull request #183 from azat/dns-example
Mark Ellzey [Wed, 17 Jun 2015 15:00:19 +0000 (08:00 -0700)]
Merge pull request #183 from azat/dns-example

Some improvements for dns-example

9 years agoMerge pull request #254 from zeliard/master
Mark Ellzey [Sun, 7 Jun 2015 16:39:24 +0000 (09:39 -0700)]
Merge pull request #254 from zeliard/master

Fix bench_httpclient to support win32

9 years agoUpdate bench_httpclient.c
Seungmo Koo [Sun, 7 Jun 2015 06:51:15 +0000 (15:51 +0900)]
Update bench_httpclient.c

*fixed: socket_geterror instead of WSAGetLastError

9 years agoMerge pull request #253 from ellzey/master
Mark Ellzey [Sat, 6 Jun 2015 09:39:29 +0000 (02:39 -0700)]
Merge pull request #253 from ellzey/master

Set correct socklen for PF_INET6 sockaddr len

9 years ago*fix: bench_httpclient to support win32
zeliard [Fri, 5 Jun 2015 07:39:26 +0000 (16:39 +0900)]
*fix: bench_httpclient to support win32

9 years agoSet correct socklen for PF_INET6 sockaddr len
Mark Ellzey [Mon, 1 Jun 2015 13:55:24 +0000 (06:55 -0700)]
Set correct socklen for PF_INET6 sockaddr len

Reported and patched by Pankaj Sharma

9 years agoMerge pull request #251 from ellzey/21_err_on_thread_init_ordering
Mark Ellzey [Fri, 29 May 2015 13:47:24 +0000 (06:47 -0700)]
Merge pull request #251 from ellzey/21_err_on_thread_init_ordering

Debug mode option to error on evthread init AFTER other event calls.

9 years agoDebug mode option to error on evthread init AFTER other event calls.
Mark Ellzey [Fri, 15 May 2015 09:58:14 +0000 (02:58 -0700)]
Debug mode option to error on evthread init AFTER other event calls.

- A handy event_enable_debug_mode() feature which will error and abort the
  application if any thread-aware libevent functions are called BEFORE the
  evthread API has been initialized (manually, or through
  evthread_use_windows_threads() / evthread_use_pthreads()

- This is done by setting the global debug variable
  'event_debug_created_threadable_ctx_' whenever the following functions
  are called:

     evthreadimpl_lock_alloc_()
     evthreadimpl_cond_alloc_()
     event_base_new_with_config() <- this checks to see if the thread
                                     callbacks are enabled first, so we
                                     have to manually set the variable.

- Example:

int main(int argc, char ** argv) {
    struct event_base * base;

    event_enable_debug_mode();

    base = event_base_new();

    evthread_use_pthreads();

    return 0;
}

When executed, the program will throw an error and exit:

[err] evthread initialization must be called BEFORE anything else!

9 years agoMerge pull request #245 from ellzey/21_size_and_misc_fixes
Mark Ellzey [Wed, 13 May 2015 05:11:08 +0000 (01:11 -0400)]
Merge pull request #245 from ellzey/21_size_and_misc_fixes

Fix garbage value in socketpair util function, stdint?

9 years agoMerge pull request #239 from ellzey/issue237
Mark Ellzey [Wed, 13 May 2015 05:10:42 +0000 (01:10 -0400)]
Merge pull request #239 from ellzey/issue237

Call underlying bev ctrl SET_FD on filtered bufferevents

9 years agoUpdate README.md
Mark Ellzey [Wed, 13 May 2015 04:52:40 +0000 (00:52 -0400)]
Update README.md

9 years agoUpdate README.md
Mark Ellzey [Wed, 13 May 2015 04:51:07 +0000 (00:51 -0400)]
Update README.md

9 years agoUpdate README.md
Mark Ellzey [Wed, 13 May 2015 04:49:08 +0000 (00:49 -0400)]
Update README.md

9 years agoUpdate travis config for status updates
Mark Ellzey [Tue, 12 May 2015 19:43:03 +0000 (15:43 -0400)]
Update travis config for status updates

9 years agoUpdate README.md
Mark Ellzey [Tue, 12 May 2015 19:33:26 +0000 (15:33 -0400)]
Update README.md

9 years agoUse autotools for appveyor until cmake is fixed.
Mark Ellzey [Tue, 12 May 2015 04:27:01 +0000 (00:27 -0400)]
Use autotools for appveyor until cmake is fixed.

9 years agoCommented out a WIN32 threading / timing test for now
Mark Ellzey [Tue, 12 May 2015 02:53:05 +0000 (22:53 -0400)]
Commented out a WIN32 threading / timing test for now

- seems as if windows has some time scale issues which I am looking
  into. For now I am commenting out the regression test until it is
  fixed.

9 years agoMerge branch 'master' into 21_size_and_misc_fixes
Mark Ellzey [Tue, 12 May 2015 02:18:54 +0000 (22:18 -0400)]
Merge branch 'master' into 21_size_and_misc_fixes

9 years agoMerge pull request #241 from ellzey/21_fix_appveyor_ssl_link
Mark Ellzey [Mon, 11 May 2015 20:27:15 +0000 (16:27 -0400)]
Merge pull request #241 from ellzey/21_fix_appveyor_ssl_link

Fix download link for appveyor SSL

9 years agoFix the link for appveyor OpenSSL installer (WIN32)
Mark Ellzey [Mon, 11 May 2015 16:47:40 +0000 (12:47 -0400)]
Fix the link for appveyor OpenSSL installer (WIN32)

* change and move the openssl self installer off to a site we own
   - the old link was 404, probably due to being replaced with a newer
     non-vuln version. But since we are only using this installer to
     auto-build with on appveyor (not as a release), then having a file
     we don't change and own seems to be a better solution.
* reduce verbosity

9 years agoMerge branch 'master' into issue237
Mark Ellzey [Mon, 11 May 2015 16:34:30 +0000 (12:34 -0400)]
Merge branch 'master' into issue237

9 years agoFix garbage value in socketpair util function, stdint?
Mark Ellzey [Mon, 11 May 2015 16:06:01 +0000 (12:06 -0400)]
Fix garbage value in socketpair util function, stdint?

* Fixed an issue with evutil_ersatz_socketpair_, listen_addr could all
  be compared against with agarbage values. So just memset it before
  using it anywhere.

* Nick might punch me in the face, but if we have stdint.h; (as in
  EVENT__HAVE_STDINT_H is defined), might as well use those instead of
  the manual [U]INT[X}_MAX/MIN muck in there now.

9 years agoMerge pull request #242 from ellzey/pullRequest118
Mark Ellzey [Sat, 9 May 2015 06:44:13 +0000 (02:44 -0400)]
Merge pull request #242 from ellzey/pullRequest118

expose bufferevent_incref/decref (with fewer modifications)

9 years agoexpose bufferevent_incref/decref (with fewer modifications)
Mark Ellzey [Wed, 6 May 2015 21:56:31 +0000 (14:56 -0700)]
expose bufferevent_incref/decref (with fewer modifications)

9 years agoCall underlying bev ctrl SET_FD on filtered bufferevents
Mark Ellzey [Tue, 5 May 2015 17:37:00 +0000 (10:37 -0700)]
Call underlying bev ctrl SET_FD on filtered bufferevents

If a bufferevent_filter is set on an underlying bufferevent which has
ctrl functions, bufferevent_filter needs to handle this.

For now I have added just BEV_CTRL_SET_FD, since this is needed for
bufferevent_sock to assign file descriptors to the proper
bufferevent_read/write callbacks.

A good example of the problem can be found in issue #237
https://github.com/libevent/libevent/issues/237

9 years agoFix potential fd leak in listener_read_cb()
Mark Ellzey [Tue, 28 Apr 2015 02:43:04 +0000 (22:43 -0400)]
Fix potential fd leak in listener_read_cb()

As pointed out by harlan_ in #libevent after running a coverity sweep.
If the listener is free'd, 'new_fd' is never closed.

9 years agotab
Greg Hazel [Wed, 25 Mar 2015 00:45:52 +0000 (17:45 -0700)]
tab

9 years agofix the return value of event_deferred_cb_schedule_
Greg Hazel [Wed, 25 Mar 2015 00:29:40 +0000 (17:29 -0700)]
fix the return value of event_deferred_cb_schedule_

9 years agoMerge pull request #220 from miniupnp/fix_warnings
Nick Mathewson [Tue, 17 Feb 2015 17:37:30 +0000 (12:37 -0500)]
Merge pull request #220 from miniupnp/fix_warnings

Fix warnings

9 years agoFix mixed declarations and code (forbidden by ISO C90)
Thomas Bernard [Mon, 16 Feb 2015 22:42:54 +0000 (23:42 +0100)]
Fix mixed declarations and code (forbidden by ISO C90)

9 years agoFix "function declaration isn’t a prototype"
Thomas Bernard [Mon, 16 Feb 2015 22:41:53 +0000 (23:41 +0100)]
Fix "function declaration isn’t a prototype"

add "void" to argument list

9 years agoMerge pull request #214 from JoakimSoderberg/appveyor
Nick Mathewson [Thu, 5 Feb 2015 20:24:55 +0000 (15:24 -0500)]
Merge pull request #214 from JoakimSoderberg/appveyor

Forgot to install OpenSSL for appveyor

9 years agoForgot to install OpenSSL for appveyor
Joakim Söderberg [Thu, 5 Feb 2015 19:21:04 +0000 (20:21 +0100)]
Forgot to install OpenSSL for appveyor

9 years agoMerge pull request #117 from JoakimSoderberg/appveyor
Nick Mathewson [Thu, 5 Feb 2015 18:37:24 +0000 (13:37 -0500)]
Merge pull request #117 from JoakimSoderberg/appveyor

Add support for appveyor.com windows CI

9 years agoAdd support for appveyor.com windows CI
Joakim Söderberg [Thu, 5 Feb 2015 18:24:19 +0000 (19:24 +0100)]
Add support for appveyor.com windows CI

This does the same thing as Travis-CI but for windows.

@nmathewson
Go to: https://ci.appveyor.com/login -> Login using Github
Click **+New Project** -> Choose **Github** to the left -> Find **Libevent** in the list and click **Add**

9 years agoMerge pull request #116 from JoakimSoderberg/fix_build_tree_cmake_config
Nick Mathewson [Thu, 5 Feb 2015 17:14:16 +0000 (12:14 -0500)]
Merge pull request #116 from JoakimSoderberg/fix_build_tree_cmake_config

This fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230

9 years agoThis fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230
Joakim Söderberg [Wed, 4 Feb 2015 23:56:58 +0000 (00:56 +0100)]
This fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230

CMake configuration files are intended to be used by other projects to find the library. Specifically the CMake find_package command can use it to find all files related to the project.

The idea is to support 2 different CMake configuration files for Libevent. One if you simply build libevent that is generated for the build tree.
And a second one that is generated for an install target that will be installed on the system and point to where on the system the lib files and such can be find.

So for instance, in the build tree the config would set the cmake variable `LIBEVENT_INCLUDE_DIRS` to `/path/to/libevent/build/include`.
And for the system config it would be set to `/usr/local/include` (or whatever target the user chose when running cmake).

27bd9faf498b91923296cc91643e03ec4055c230 changed this behavior so that both configs would point to the system wide path `/usr/local/include`

This meant that projects just wanting to import directly for the build tree would fail.

9 years agoMerge remote-tracking branch 'azat/be-pair-fix-freeing-shared-lock-v5'
Nick Mathewson [Wed, 4 Feb 2015 13:37:32 +0000 (08:37 -0500)]
Merge remote-tracking branch 'azat/be-pair-fix-freeing-shared-lock-v5'

9 years agoMerge pull request #207 from azat/avoid-leaking-of-event_debug_map_HT_GROW
Nick Mathewson [Wed, 4 Feb 2015 13:33:42 +0000 (08:33 -0500)]
Merge pull request #207 from azat/avoid-leaking-of-event_debug_map_HT_GROW

Avoid leaking of event_debug_map_HT_GROW

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 agobe_pair/regress: cover use of shared lock (lock/unlock/free)
Azat Khuzhin [Sun, 25 Jan 2015 21:31:23 +0000 (00:31 +0300)]
be_pair/regress: cover use of shared lock (lock/unlock/free)

For more info look at 92a359ee3adf4636db508e6c6d7179d4d59eaafc
("be_pair: release shared lock with the latest of bufferevent_pair")

9 years agoevent_free_debug_globals_locks(): disable lock debugging
Azat Khuzhin [Sun, 25 Jan 2015 21:29:15 +0000 (00:29 +0300)]
event_free_debug_globals_locks(): disable lock debugging

This will allow to use library event after
event_free_debug_globals_locks()/libevent_global_shutdown() without
invalid read/write's.

9 years agoevthread: evthreadimpl_disable_lock_debugging_() for libevent_global_shutdown()
Azat Khuzhin [Sun, 25 Jan 2015 21:28:46 +0000 (00:28 +0300)]
evthread: evthreadimpl_disable_lock_debugging_() for libevent_global_shutdown()

9 years agoevthread: add evthread_get_{lock,condition}_callbacks() helpers
Azat Khuzhin [Sun, 25 Jan 2015 21:27:41 +0000 (00:27 +0300)]
evthread: add evthread_get_{lock,condition}_callbacks() helpers

9 years agobe_pair: release shared lock with the latest of bufferevent_pair
Azat Khuzhin [Sat, 3 Jan 2015 16:37:15 +0000 (19:37 +0300)]
be_pair: release shared lock with the latest of bufferevent_pair

Then next code sample will use free'd lock:
  evthread_use_pthreads();
  ...
  assert(!bufferevent_pair_new(base, BEV_OPT_THREADSAFE, pair));
  ...
  bufferevent_free(pair[0]); # refcnt == 0 -> unlink
  bufferevent_free(pair[1]); # refcnt == 0 -> unlink
  ...
  event_base_free() -> finalizers -> EVTHREAD_FREE_LOCK(bev1->lock)
                                  -> BEV_LOCK(bev2->lock) <-- *already freed*

While if you will reverse the order:
  bufferevent_free(pair[1]); # refcnt == 0 -> unlink
  bufferevent_free(pair[0]); # refcnt == 0 -> unlink
  ...
  event_base_free() -> finalizers -> BEV_LOCK(bev2->lock)/!own_lock/BEV_UNLOCK(bev2->lock)
                                  -> EVTHREAD_FREE_LOCK(bev1->lock) (own_lock)

It is ok now, but I guess that it will be better to relax order of
freeing pairs.

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 agoregress_dns: drop hack for event_debug_map_HT_GROW in leak tests
Azat Khuzhin [Thu, 8 Jan 2015 01:45:49 +0000 (04:45 +0300)]
regress_dns: drop hack for event_debug_map_HT_GROW in leak tests

9 years agoevent: call event_disable_debug_mode() in libevent_global_shutdown()
Azat Khuzhin [Thu, 8 Jan 2015 01:45:27 +0000 (04:45 +0300)]
event: call event_disable_debug_mode() in libevent_global_shutdown()

This will avoid leaking of event_debug_map_HT_GROW

I buildin it into libevent_glboal_shutdown() because
event_disable_debug_mode() -> event_free_debug_globals() ->
event_free_debug_globals_locks() will clean event_debug_map_lock_ that
used in event_disable_debug_mode().

9 years agoht-internal: don't reset hth_table_length explicitly in name_##HT_CLEAR
Azat Khuzhin [Thu, 8 Jan 2015 01:43:37 +0000 (04:43 +0300)]
ht-internal: don't reset hth_table_length explicitly in name_##HT_CLEAR

name_##HT_CLEAR calls name_##HT_INIT that reset hth_table_length to 0.

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 agodns-example: allow to set ns from args
Azat Khuzhin [Sat, 8 Nov 2014 12:51:49 +0000 (15:51 +0300)]
dns-example: allow to set ns from args

We can't do this using resolv.conf:
$ dns-example -v -c <(echo nameserver 127.0.0.1:10053) ya.ru
Because of how evutil_read_file_() works (using fstat())

And actually glibc for example will not use port from nameserver line, and
because of inet_aton() it will fail if nameserver will have arbitary port:
(gdb) p inet_aton("127.0.0.1", malloc(10000))
$1 = 1
(gdb) p inet_aton("127.0.0.1:53", malloc(10000))
$2 = 0

From glibc/resolv/res_init.c:
  if (MATCH(buf, "nameserver") && nserv < MAXNS) {
      struct in_addr a;
      cp = buf + sizeof("nameserver") - 1;
      while (*cp == ' ' || *cp == '\t')
          cp++;
      if ((*cp != '\0') && (*cp != '\n')
          && __inet_aton(cp, &a)) {
          statp->nsaddr_list[nservall].sin_addr = a;
          statp->nsaddr_list[nservall].sin_family = AF_INET;
          statp->nsaddr_list[nservall].sin_port =
                  htons(NAMESERVER_PORT);

10 years agodns-example: convert to getopt()
Azat Khuzhin [Sat, 8 Nov 2014 12:41:33 +0000 (15:41 +0300)]
dns-example: convert to getopt()

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'