3425 Commits

Author SHA1 Message Date
Mark Ellzey
c2aa7dcb70 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
2015-05-05 10:37:00 -07:00
Mark Ellzey
a695a720cd 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.
2015-04-27 22:43:04 -04:00
Greg Hazel
6e7a580c15 tab 2015-03-24 17:45:52 -07:00
Greg Hazel
38cef641c4 fix the return value of event_deferred_cb_schedule_ 2015-03-24 17:29:40 -07:00
Nick Mathewson
31c6d45f8d Merge pull request #220 from miniupnp/fix_warnings
Fix warnings
2015-02-17 12:37:30 -05:00
Thomas Bernard
0c7f21781a Fix mixed declarations and code (forbidden by ISO C90) 2015-02-16 23:42:54 +01:00
Thomas Bernard
746d2c502c Fix "function declaration isn’t a prototype"
add "void" to argument list
2015-02-16 23:41:53 +01:00
Nick Mathewson
d59113a443 Merge pull request #214 from JoakimSoderberg/appveyor
Forgot to install OpenSSL for appveyor
2015-02-05 15:24:55 -05:00
Joakim Söderberg
26164a560d Forgot to install OpenSSL for appveyor 2015-02-05 20:56:10 +01:00
Nick Mathewson
874ea871f7 Merge pull request #117 from JoakimSoderberg/appveyor
Add support for appveyor.com windows CI
2015-02-05 13:37:24 -05:00
Joakim Söderberg
5f89c37e00 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**
2015-02-05 19:24:19 +01:00
Nick Mathewson
deca354cba Merge pull request #116 from JoakimSoderberg/fix_build_tree_cmake_config
This fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230
2015-02-05 12:14:16 -05:00
Joakim Söderberg
19ba454317 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.
2015-02-05 17:34:50 +01:00
Nick Mathewson
a77a82a03f Merge remote-tracking branch 'azat/be-pair-fix-freeing-shared-lock-v5' 2015-02-04 08:37:32 -05:00
Nick Mathewson
51821e20b2 Merge pull request #207 from azat/avoid-leaking-of-event_debug_map_HT_GROW
Avoid leaking of event_debug_map_HT_GROW
2015-02-04 08:33:42 -05:00
Nick Mathewson
4472ec68e6 Merge pull request #212 from xbao/master
changed strtotimeval signature to avoid conflict with Android NDK sys/time.h header (#211)
2015-02-03 15:57:31 -05:00
Nick Mathewson
1cae3ae167 Merge remote-tracking branch 'public/master' 2015-02-02 13:57:50 -05:00
Nick Mathewson
537177d315 New function to get address for nameserver. 2015-02-02 13:57:22 -05:00
Xiao Bao Clark
bdbc823f7e changed strtotimeval signature as per #211 2015-01-28 17:17:02 +11:00
Nick Mathewson
62eaa889cc Merge pull request #210 from mc-server/master
Added cmake-generated files to ignore list.
2015-01-27 10:07:22 -05:00
Matyas Dolak
6c12bfec1d Added cmake-generated files to ignore list.
These are generated by cmake on Windows with MSVC.
2015-01-27 15:30:52 +01:00
Azat Khuzhin
a558fcdb43 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")
2015-01-26 00:40:09 +03:00
Azat Khuzhin
e5c87d18b0 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.
2015-01-26 00:40:09 +03:00
Azat Khuzhin
ccc55937cf evthread: evthreadimpl_disable_lock_debugging_() for libevent_global_shutdown() 2015-01-26 00:40:09 +03:00
Azat Khuzhin
c0b34f6fd5 evthread: add evthread_get_{lock,condition}_callbacks() helpers 2015-01-26 00:40:09 +03:00
Azat Khuzhin
92a359ee3a 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.
2015-01-26 00:40:02 +03:00
Nick Mathewson
4d66552a47 Merge pull request #115 from jer-gentoo/master
EVBUFFER_PTR_SET -> EVBUFFER_PTR_ADD
2015-01-22 12:15:01 -05:00
jer-gentoo
8674e4fb0a EVBUFFER_PTR_SET -> EVBUFFER_PTR_ADD
Looks like EVBUFFER_PTR_ADD should have been used instead of EVBUFFER_PTR_SET.
2015-01-21 11:24:23 +01:00
Azat Khuzhin
3540a193b5 regress_dns: drop hack for event_debug_map_HT_GROW in leak tests 2015-01-08 04:51:27 +03:00
Azat Khuzhin
941faaed39 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().
2015-01-08 04:49:28 +03:00
Azat Khuzhin
597c7b259b 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.
2015-01-08 04:43:37 +03:00
Nick Mathewson
0b49ae3459 Update changelog release-2.1.5-beta 2015-01-05 09:33:48 -05:00
Nick Mathewson
2c827e76e7 Merge branch '21_cve_2014_6272_v2' 2015-01-05 09:33:02 -05:00
Nick Mathewson
841ecbd961 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.
2015-01-05 09:32:53 -05:00
Nick Mathewson
683f5568ab Increment version to 2.1.5-beta 2015-01-05 09:16:12 -05:00
Nick Mathewson
0eb391941b work on changelog for 2.1.5-alpah 2015-01-05 08:50:30 -05:00
Nick Mathewson
8a29f3b3ae Merge pull request #201 from nsuke/cmake-shared-build
Fix CMake shared library build
2015-01-04 10:27:02 -05:00
Nobuaki Sukegawa
e69d910948 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
2015-01-03 02:28:08 +09:00
Nick Mathewson
f05a0d53a6 Merge pull request #197 from JohnOhl/fix-clang-compile-warnings
Fix warnings when compiling with clang 3.5
2014-12-23 09:35:40 -05:00
John Ohl
f5b476570d Fix warnings when compiling with clang 3.5 2014-12-22 00:46:56 -05:00
Nick Mathewson
cb737041e2 Fix annoying heisenbug in test-time.c 2014-12-15 12:51:01 -05:00
Nick Mathewson
37df827a01 Merge pull request #192 from miniupnp/master
Fix mixed declarations and code (forbidden by ISO C90)
2014-12-08 10:26:01 -05:00
Thomas Bernard
8afbdbc470 Fix mixed declarations and code (forbidden by ISO C90) 2014-12-08 10:21:00 +01:00
Andrea Shepard
f2645f80c1 Implement new/free for struct evutil_monotonic_timer and export monotonic time functions 2014-12-04 09:30:20 -05:00
Nick Mathewson
6ae44b5da9 Merge remote-tracking branch 'origin/patches-2.0' 2014-12-01 08:32:23 -05:00
Nick Mathewson
fb7e76aec5 Fix evbuffer_peek() with len==-1 and start_at non-NULL. 2014-12-01 08:32:05 -05:00
Nick Mathewson
37145c5659 Merge remote-tracking branch 'public/patches-2.0'
Conflicts:
	ChangeLog
	event.c
2014-11-30 21:07:55 -05:00
Nick Mathewson
1da2f42bdb Merge branch 'patches-2.0' of github.com:libevent/libevent into patches-2.0 2014-11-30 21:02:25 -05:00
Nick Mathewson
d9469d396f Start on 2.1.5-alpha/beta changelog 2014-11-30 21:02:06 -05:00
Nick Mathewson
5ae5287214 Work on the changelog for 2.0.22 2014-11-30 19:38:23 -05:00