On systems where a previous version of Libevent is installed we don't want the system version of the headers to be included before the ones in the build tree. This happened on my OSX system where I had an ancient version of Libevent installed. It would then load the incorrect event-config.h and fail because the system introspection macros weren't set properly.
Diego Giagio [Sat, 18 Jan 2014 01:20:42 +0000 (23:20 -0200)]
Implemented EV_CLOSED event for epoll backend (EPOLLRDHUP).
- Added new EV_CLOSED event - detects premature connection close
by clients without the necessity of reading all the pending
data. Does not depend on EV_READ and/or EV_WRITE.
- Added new EV_FEATURE_EARLY_CLOSED feature for epoll.
Must be supported for listening to EV_CLOSED event.
- Added new regression test: test-closed.c
- All regression tests passed (test/regress and test/test.sh)
Andrew Sweeney [Mon, 6 Jan 2014 01:35:46 +0000 (20:35 -0500)]
Provide on request complete callback facility
This patch provides the ability to receive a callback on the completion of a
request. The callback takes place immediately before the request's resources
are released.
Andrew Sweeney [Mon, 30 Dec 2013 19:06:20 +0000 (14:06 -0500)]
Add access to max event count stats
This commit provides an interface for accessing and resetting the maximum
number of events in a given period. This information provides better insight
into event queue pressure.
Nick Mathewson [Tue, 24 Dec 2013 16:30:06 +0000 (11:30 -0500)]
Minor optimizations on bufferevent_trigger options
By making BEV_TRIG_DEFER_CALLBACKS equal to BEV_OPT_DEFER_CALLBACKS,
and BEV_TRIG_IGNORE_WATERMARKS disjoint from BEV_OPT_*, we can save a
few operations in bufferevent_run_*, which is critical-path.
Nick Mathewson [Tue, 24 Dec 2013 16:20:52 +0000 (11:20 -0500)]
Make bufferevent_trigger_nolock_() inline
Since most of its callers are using constant EV_READ or EV_WRITE, and
using constant 0 as its argument, this should eliminate most of the
overhead for this function in the fast case.
Joakim Soderberg [Tue, 17 Dec 2013 13:07:14 +0000 (14:07 +0100)]
Change the BSD license from 4 to 3-clause.
This makes it GPL compatible. Changing the license from 4 to 3-clause BSD
license is OK according to a Berkley announcement on July 22, 1999 by
William Hoskins, the director of the fofice of technology licensing for
Berkley:
Joakim Soderberg [Mon, 16 Dec 2013 16:44:13 +0000 (16:44 +0000)]
Added a "make verify" target.
This is more than for cosmetic purposes to match how it's done with autoconf.
Due to the fact that we use environment variables to turn off certain backends during the tests, simply running "ctest" or "make test" can result in failed tests.
This is because if you do "EVENT_NOEPOLL=yes && export EVENT_NOEPOLL" and then run the tests, when running the epoll tests, the EPOLL backend will be turned off. There is no way of unsetting an environment variable for a test in CMake, you can only set them. And since libevent simply checks if the environment variable is set (it doesn't check the actual value of it), this won't work.
So to remedy this, we create the "make verify" target that first unsets all the EVENT_NO* environment variables, and then runs ctest.
Also bumped the required CMake version from 2.6 to 2.8, since the set_test_properties(bla PROPERTIES ENVIRONMENT "SOME_VAR") requires 2.8
Added some explicit dependencies for the test programs to libevent, so they don't just fail if you try to run the tests without first doing "make"
Joakim Soderberg [Mon, 16 Dec 2013 15:37:51 +0000 (16:37 +0100)]
Only test the event backends available on the system.
Fix how the CMake project adds the tests using the different backends. At
first we tried to do it exactly as it's done in test/test.sh.
However, test.sh uses a special program test-init to decide if a given
backend is available or not before running the actual tests. Doing it this way
will not be possible using CMake. Since then we would have to have the
test-init executable compiled at the time we run CMake, to know what tests
we should add. (And since CMake generates the make/project files that
compiles the executables, there's a catch 22).
Instead of deciding what tests to run this way, we simply use the result
of the CMake system introspection (that figures out what backends are
available) to decide what backend tests to add.
Nick Mathewson [Fri, 6 Dec 2013 15:50:17 +0000 (10:50 -0500)]
Rename flush_outdated_host_addresses to clear_host_addresses
"flush" can imply writing something out to a file or connection before
clearing it; "clear" always means "remove". It's also potentially
misleading to say "outdated" here, since the function removes _all_
addresses regardless, not just certain outdated ones.
Also, don't free the lock in this function. Also reindent the function.
Kuldeep Gupta [Fri, 6 Dec 2013 11:36:20 +0000 (17:06 +0530)]
bug fix for issues #293 evdns_base_load_hosts doesn't remove outdated addresses
As mentioned at https://sourceforge.net/p/levent/bugs/293/
created a small function "evdns_base_flush_outdated_host_addresses" which removes all the previous host addresses, if user wants to clean up the list of hosts can call and use this function.
Defination of this function is part of another patch.
Kuldeep Gupta [Fri, 6 Dec 2013 11:23:16 +0000 (16:53 +0530)]
bug fix for issues #293 evdns_base_load_hosts doesn't remove outdated adresses
As mentioned at https://sourceforge.net/p/levent/bugs/293/
created a small function "evdns_base_flush_outdated_host_addresses" which removes all the previous requests of hosts , if user wants to clean up the list of hosts can call and use this function.
Requires function declaration to be added in include/event2/dns.h
Adding it in another patch for the same bug.
Julien BLACHE [Sat, 2 May 2009 18:40:11 +0000 (20:40 +0200)]
Add a variant of evhttp_send_reply_chunk() with a callback on evhttp_write_buffer()
evhttp_write_buffer() used by evhttp_send_reply_chunk() can take callback
executed when (part of) the buffer has been written. Using this callback to
schedule the next chunk avoids buffering large amounts of data in memory.