include/event2


Log

Author Commit Date CI Message
Nick Mathewson 127d4f21 2010-09-23T16:49:58 Add a LEV_OPT_THREADSAFE option for threadsafe evconnlisteners
Simon Perreault c4be8d82 2010-09-20T12:47:39 Add error callback to evconnlistener
Christopher Davis 2447fe88 2010-08-28T04:07:48 Add event_config_set_num_cpus_hint for tuning thread pools, etc.
Nick Mathewson 42090072 2010-09-06T15:47:07 Move the "function to getsockname() on a listener" to regress_testutils This reverts commit fab50488fcb741884ccdfa7b83643eac3e5c9cbf. The function was, on reflection, not important enough to break the feature freeze, since it's trivial to build on your own.
Nick Mathewson c51826ff 2010-09-06T15:40:13 Merge remote branch 'github/sysqueue_include_order'
Nick Mathewson 19521436 2010-09-03T16:42:16 Expose a function to add a nameserver by sockaddr
Nick Mathewson fab50488 2010-09-03T16:41:16 Expose a function to getsockname() on a listener's fd.
Nick Mathewson ca9048f1 2010-09-02T11:36:44 Move evkeyvalq into a separate header for evhttp_parse_query users The evhttp_parse_query API is a bit misdesigned; all the other evkeyvalq stuff is abstract and lets you get away with having a header stub, but evhttp_parse_query seems to require that you instantiate an empty evkeyvalq of your own.
Nick Mathewson d3ceca80 2010-09-02T11:27:57 Declare evkeyvalq and event_list even if event_struct.h comes before sys/queue.h Fixes bug 3036645 reported by Mihai Draghicioiu
Nick Mathewson d4977b52 2010-08-17T13:15:34 Add a condition variable backend, with implementations for pthreads and win32 The interface from the user's POV is similar to the locking implementation: either provide a structure full of function pointers, or just call evthread_use_*_threads() and everything will be okay. The internal interface is meant to vaguely resemble pthread_cond_*, which Windows people will better recognize as *ConditionVariable*.
Gilad Benjamini 60433a0a 2010-08-13T17:08:59 Clean up syntax on TAILQ_ENTRY() usage Though the C standards allow it, it's apparently possible to get MSVC upset by saying "struct { int field; } (declarator);" instead of "struct {int field; } declarator;", so let's just not do that. Bugfix for 3044492 (commit msg by nickm)
Nick Mathewson 33200e72 2010-08-10T15:03:14 Document that DNS_NO_SEARCH is an obsolete alias for DNS_QUERY_NO_SEARCH
Nick Mathewson 3808168d 2010-08-10T15:02:50 Completely remove the (mostly-removed) obsolete thread functions.
Nick Mathewson ec347b92 2010-07-07T16:45:03 Move event-config.h to include/event2 This change means that all required include files are in event2, and all files not in event2/* are optional.
Nick Mathewson 6ae53d67 2010-08-04T15:44:08 Add an interface to expose min_share in ratelimiting groups
Nick Mathewson cc2379d2 2010-07-26T14:48:32 Constify a couple of arguments to evdns_server_request_add_*_reply
Nick Mathewson e1c1167c 2010-07-22T14:38:08 Replace (unused,always 0) is_tcp argument to evdns_add_server_port*() with flags Since we weren't using it for anything, and we always failed if it was set, we're allowed to change the future semantics of setting it.
Nick Mathewson 215e629c 2010-06-21T12:26:21 Add bufferevent_lock()/bufferevent_unlock() Although bufferevent operations are threadsafe, sometimes you need to make sure that a few operations on a single bufferevent will all be executed with nothing intervening. That's what these functions are for.
Nick Mathewson 7b259b67 2010-06-21T12:24:49 Fix sentence fragment in docs for event_get_struct_event_size()
Nick Mathewson e21f5d15 2010-06-19T18:21:40 Document a change in the semantics of event_get_struct_event_size()
Nick Mathewson 276e7ee9 2010-06-11T11:57:13 Fix a pedantic gcc 4.4 warning in event2/event.h
Nick Mathewson 17a8e2d7 2010-06-07T12:06:43 Add a function to retrieve the other side of a bufferevent pair
Felix Nawothnig 06bd0563 2010-05-26T12:50:59 Fix the default HTTP error template The current template... <HTML><HEAD><TITLE>%s</TITLE> </HEAD><BODY> <H1>Method Not Implemented</H1> Invalid method in request<P> </BODY></HTML> is highly confusing. The given title is easily overlooked and the hard-coded content is just plain wrong in most cases (I really read this as "the server did not understand the requested HTTP method) This patch changes the template to include the error reason in the body as well as in the header, and to infer the proper reason from the status code whenever the reason argument is NULL. This patch also removes a redundant evhttp_add_header from evhttp_send_error; evhttp_send_page already adds a "Connection: close" header.
Nick Mathewson fdfc3fc5 2010-05-13T11:23:12 Remove the now-unusable EVTHREAD_LOCK/UNLOCK constants
Nick Mathewson 7c519dfd 2010-05-08T23:29:29 Fix some autoconf issues on OpenBSD Issue 1: autoconf gets accept when a header works properly with cpp but not with cc. This was true of the sys/sysctl.h header on openbsd. The fix: include sys/param.h (if present) when testing for sys/sysctl.h Issue 2: Somehow, autoconf's macro generation code is messed up on some versions of openbsd (including mine, and other people's too) so that instead of SIZEOF_VOID_P, it makes SIZEOF_VOID__. evutil/util.h now works around that.
Nick Mathewson a62c8433 2010-05-06T14:16:50 Merge commit 'chrisd/connect-hostname-report-err'
Nick Mathewson c16e6844 2010-05-04T13:27:36 Rename current_base symbol to event_global_current_base_ The "current_base" symbol was never actually declared in an exported header; it's hideously deprecated, and it was the one remaining exported symbol (fwict) that was prefixed with neither ev nor bufferevent nor _ev nor _bufferevent. codesearch.google.com turns up no actual attempts to use our current_base from outside libevent.
Joachim Bauch a5208fe4 2010-04-27T13:42:26 Release locks on bufferevents while executing callbacks This fixes a dead lock for me where bufferevents in different event loops use each other and access their input/output buffers (proxy-like scenario).
Christopher Davis 0ef40706 2010-04-24T00:06:38 Report DNS error when lookup fails during bufferevent_socket_connect_hostname.
Nick Mathewson a5bf43ab 2010-03-04T01:14:32 Document evutil_secure_rng_init() and evutil_secure_rng_add_bytes()
Sebastian Sjöberg 899c1dcc 2010-04-14T15:42:57 Replace EVUTIL_CLOSESOCKET macro with a function The EVUTIL_CLOSESOCKET() macro required you to include unistd.h in your source for POSIX. We might as well turn it into a function: an extra function call is going to be cheap in comparison with the system call. We retain the EVUTIL_CLOSESOCKET() macro as an alias for the new evutil_closesocket() function. (commit message from email by Nick and Sebastian)
Shuo Chen 755fbf16 2010-04-14T14:27:29 Add void* arguments to request_new and reply_new evrpc hooks This makes evprc setup more extensible, and helps with Shuo Chen's work on implementing Google protocol buffers rpc on top of Libevent 2 evrpc. This patch breaks binary compatibility with previous versions of Libevent, since it changes struct evrpc and the signature of evrpc_register_generic(). Since all compliant code should be calling evrpc_register_generic via EVRPC_REGISTER, it shouldn't break source compatibility. (Code by Shuo Chen; commit message by Nick)
Shuo Chen 07edf784 2010-04-14T14:23:03 Expose the request and reply members of rpc_req_generic() This code adds two accessor functions to evprc, and helps integrate evrpc with Google protocol buffers. (Code by Shuo Chen; commit message by nickm)
Nick Mathewson eb86c8c5 2010-04-12T22:24:54 Add evbuffer_copyout to copy data from an evbuffer without draining The evbuffer_remove() function copies data from the front of an evbuffer into an array of char, and removes the data from the buffer. This function behaves the same, but does not remove the data. This behavior can be handy for lots of protocols, where you want the evbuffer to accumulate data until a complete record has arrived. Lots of people have asked for a function more or less like this, and though it isn't too hard to code one from evbuffer_peek(), it is apparently annoying to do it in every app you write. The evbuffer_peek() function is significantly faster, but it requires that the user be able to handle data in separate extents. This patch also reimplements evbufer_remove() as evbuffer_copyout() followed by evbuffer_drain(). I am reasonably confident that this won't be a performance hit: the memcpy() overhead should dominate the cost of walking the list an extra time.
Nick Mathewson fb366c1d 2010-03-21T13:16:31 Functions to track the total bytes sent over a rate limit group.
Nick Mathewson ee41aca6 2010-03-12T00:46:39 Functions to manipulate existing rate limiting groups. This patch adds a function to change the current rate limit of a rate limiting group, and another to free an empty rate limiting group.
Nick Mathewson b2f2be6e 2010-03-10T16:25:16 Make evdns use the regular logging system by default Once, for reasons that made sense at the time, we had evdns.c use its own logging subsystem with two levels, "warn" and "debug". This leads to problems, since setting a log handler for Libevent wouldn't actually trap these messages, since they weren't on by default, and since some of the warns should really be msgs. This patch changes the default behavior of evdns.c to log to event_(debugx,warnx,msgx) by default, and adds a new (internal-use-only) log level of EVDNS_LOG_MSG. Programs that set a evdns logging function will see no change. Programs that don't will now see evdns warnings reported like other warnings.
Nick Mathewson 17efc1cd 2010-03-04T01:25:51 Update all our copyright notices to say "2010"
Nick Mathewson 2fac0f70 2010-03-03T12:15:15 Remove signal_assign() and signal_new() macros. These were introduced and deprecated in the same version (2.0.1-alpha), presumably in two-stage process. Everybody sane should be using evsignal_assign() and evsignal_new() instead.
Nick Mathewson d3288293 2010-02-20T18:44:35 Provide consistent, tested semantics for bufferevent timeouts The different bufferevent implementations had different behavior for their timeouts. Some of them kept re-triggering the timeouts indefinitely; some disabled the event immediately the first time a timeout triggered. Some of them made the timeouts only count when the bufferevent was actively trying to read or write; some did not. The new behavior is modeled after old socket bufferevents, since they were here first and their behavior is relatively sane. Basically, each timeout disables the bufferevent's corresponding read or write operation when it fires. Timeouts are stopped whenever we suspend writing or reading, and reset whenever we unsuspend writing or reading. Calling bufferevent_enable resets a timeout, as does changing the timeout value.
Nick Mathewson 162ce8a8 2010-02-23T00:38:30 Expose view of current rate limit as constrained by group limit
Nick Mathewson 4faeaea9 2010-02-19T03:39:50 Clean up formatting: function/keyword spacing consistency. - Keywords always have a space before a paren. Functions never do. - No more than 3 blank lines in a row.
Nick Mathewson e5cf9879 2010-02-18T17:46:56 Clean up formatting: remove trailing spaces
Nick Mathewson e5bbd40a 2010-02-18T17:41:15 Clean up formatting: use tabs, not 8-spaces, to indent.
Nick Mathewson 8fdf09c0 2010-02-18T17:08:50 Clean up formatting: Disallow space-before-tab.
Nick Mathewson ca46d25b 2010-02-17T23:02:28 Merge branch 'arc4random'
Nick Mathewson 3fe60fdf 2010-02-12T23:40:13 Use off_t for the length parameter of evbuffer_add_file
Nick Mathewson d4de062e 2010-02-10T17:19:18 Add an arc4random implementation for use by evdns Previously, evdns was at the mercy of the user for providing a good entropy source; without one, it would be vulnerable to various active attacks. This patch adds a port of OpenBSD's arc4random() calls to Libevent [port by Chris Davis], and wraps it up a little bit so we can use it more safely.
Nick Mathewson 1dd7e6dc 2010-02-05T01:16:23 Remove the 'flags' argument from evdns_base_set_option() The 'flags' argument made sense when passed to evdns_(base_)?parse_resolv_conf when it said which parts of the resolv.conf file to obey. But for evdns_set_option(), it was really silly, since you wouldn't be calling evdns_set_option() unless you actually wanted to set the option. Its meaning was basically, "set this to DNS_OPTIONS_ALL unless you want a funny surprise." evdns_base_set_option was new in 2.0.1-alpha, so we aren't committed to keeping it source-compatible.
Nick Mathewson cfe7a9ff 2010-02-04T10:15:39 Merge remote branch 'niels/http_chunk'
Niels Provos 39781801 2010-02-03T16:54:18 make evhttp_send() safe against terminated connections, too
Nick Mathewson e2d15d81 2010-02-03T17:52:55 Merge remote branch 'niels/http_chunk'
Niels Provos 93d73691 2010-02-03T14:34:56 do not fail while sending on http connections the client closed. when sending chunked requests via multiple calls to evhttp_send_reply_chunk, the client may close the connection before the server is done sending. this used to cause a crash. we introduce a new function evhttp_request_get_connection() that allows the server to determine if the request is still associated with a connection. If it's not, evhttp_request_free() needs to be called explicitly or the user can call evhttp_send_reply_end() which just frees the request, too.
Nick Mathewson 60742d58 2010-02-03T17:01:45 Add the rest of the integer limits, and add a test for them.
Nick Mathewson 85047a69 2010-02-03T15:12:04 Functions to view and manipulate rate-limiting buckets. We need these for Tor, and other projects probably need them too. Uses include: - Checking whether bandwidth is mostly-used, and only taking some actions when there's plenty of bandwidth. - Deducting some non-bufferevent activities from a rate-limit group.
Nick Mathewson aba1fff3 2010-02-03T14:37:42 Add EV_*_MAX macros to event2/util.h to expose limits for ev_* types.
Nick Mathewson da6135e3 2010-02-03T02:09:19 Reduce windows header includes in our own headers. It turns out that absolutely everything that was including windows.h was doing so needlessly; our headers don't need it, so we should just include winsock2.h (since that's where struct timeval is defined). Pre-2.0 code will use the old headers, which include windows.h for them, so we aren't breaking source compatibility with 1.4. This solves the bug where we were leaving WIN32_LEAN_AND_MEAN defined, in roughly the same way that buying an automobile solves the question of what to give your coachman for boxing day.
Nick Mathewson 27c9a40f 2010-02-03T02:08:08 Fix a dumb typo in ev_intptr_t definitions. We said "#define ev_uintptr_t" twice instead of ever saying "#define ev_intptr_t".
Nick Mathewson 6c21c895 2010-02-03T01:22:44 Remove EVUTIL_CHECK_FMT. This was never supposed to be an exposed API, so its name should have been more like _EVUTIL_CHECK_FMT. But it was only used in one place, so let's just eliminate it.
Nick Mathewson f6b26949 2010-02-03T01:16:47 Deprecate EVENT_FD and EVENT_SIGNAL. These are old aliases for event_get_fd and event_get_signal, and they haven't been the preferred way of doing things since 2.0.1-alpha. For a while, we made them use struct event if it was included, but call event_get_(fd|signal) if it wasn't. This was entirely too cute.
Nick Mathewson d38a7a19 2010-02-02T15:44:10 const-ify a few more functions in event.h
Nick Mathewson 1fa4c81c 2010-01-26T12:06:41 Add ev_[u]intptr_t to include/event2/util.h We already emulate most of the other useful bits of stdint.h, and we seem to have started to use uintptr_t in a few places throughout the code. Let's make sure we can continue to do so even on backwards platforms that don't do C99.
Nick Mathewson 361da8f2 2010-01-25T13:54:14 Note a missing ratelim function
Nick Mathewson cd17c3ac 2010-01-22T00:34:37 Add support for a "debug mode" to try to catch common errors. Right now it only catches cases where we aren't initializing events, or where we are re-initializing events without deleting them first. These are however shockingly common.
Nick Mathewson 70a4a3ef 2010-01-23T16:47:54 Remove a needless include of rpc_compat.h Nothing in evrpc.c was using rpc_compat.h, so it's best to take it out, especially since it polluted our build process with GCC variadic macros. While we're at it, this patch puts an extra restriction on when the variadic macros in rpc_compat.h are defined. Not only must GCC be the compiler, but GCC must not be running in -ansi mode.
Nick Mathewson 918e9c5e 2010-01-23T16:38:36 Fix a number of warnings from gcc -pedantic
Nick Mathewson ff3f6cd4 2010-01-22T16:14:49 Check more internal event_add() calls for failure Most of these should be unable to fail, since adding a timeout generally always works. Still, it's better not to try to be "too smart for our own good here." There are some remaining event_add() calls that I didn't add checks for; I've marked those with "XXXX" comments.
Nick Mathewson 06839503 2010-01-19T14:01:36 Functions to access more fields of struct event. Once event_assign() or event_new() had been called, there was no way to get at a copy of the event's callback, callback argument, or configured events. This patch adds an accessor function for each, and an all-fields accessor for code that wants to re-assign one field of an event. This patch also adds a function to return sizeof(struct event), so that code with intense RAM needs can still retain ABI compatibility between versions of Libevent without having to heap-allocate every struct event individually. The code here was first proposed by Pavel Pisa.
Niels Provos 5032e526 2010-01-14T15:42:07 do not use a function to assign the evdns base; instead assign it via evhttp_connection_base_new() which is a new function introduced in 2.0
Nick Mathewson c698b77d 2009-12-30T00:11:27 Allow http connections to use evdns for hostname looksups. This was as simple as using bufferevent_connect_hostname instead of calling connect() ourself, which already knows how to use an evdns_base if it gets one. Untangling the bind code might be a little trickier.
Nick Mathewson b9f43b23 2010-01-11T20:47:36 Add a comment on evthread_enable_lock_debuging.
Nick Mathewson 72dd6667 2009-12-07T17:21:41 evdns_getaddrinfo() now supports the /etc/hosts file. The regular blocking evutil_getaddrinfo() already supported /etc/hosts by falling back to getaddrinfo() or gethostbyname(). But evdns_getaddrinfo() had no such facility. Now it does. The data structure here isn't very clever. I guess people with huge /etc/hosts files will either need to get out of the 1980s, or submit a patch to this code so that it uses a hashtable instead of a linked list. Includes basic unit tests.
Nick Mathewson ba2945f9 2010-01-06T17:59:44 Merge branch 'ratelimit' Conflicts: bufferevent_async.c
Nick Mathewson 1e56a32d 2009-12-29T16:04:16 Make the initial nameserver probe timeout configurable. When we decide that a nameserver is down, we stop sending queries to it, except to periodically probe it to see if it has come back up. Our previous probe sechedule was an ad-hoc and hard-wired "10 seconds, one minute, 5 minues, 15 minutes, 1 hour, 1 hour, 1 hour...". There was nothing wrong with having it be ad-hoc, but making it hard-wired served no good purpose. Now the user can set the initial timeout via a new "initial-probe-timeout:" option; future timeouts back off by a factor of 3 on every failure to a maximum of 1 hour. As a side-benefit, this lets us cut the runtime of the dns/retry test from about 40 seconds to about 3 seconds. Faster unit tests are always a good thing.
Jardel Weyrich d0939d2b 2009-12-29T16:21:26 Introduced evutil_make_socket_closeonexec() to preserve fd flags for F_SETFD. Use this to eliminate the various macros that called F_SETFD throughout the code.
Nick Mathewson 737c9cd8 2009-11-27T13:16:54 Rate-limiting for bufferevents; group and individual limits are supported. The fairness algorithms are not the best, not every bufferevent type is supported, and some of the locking tricks here are simply absurd. Still, this code should be a good first step.
Nick Mathewson 47854a80 2009-12-28T01:40:37 Expose our cached gettimeofday value with a new interface I've got a two use case that wants this for a fairly sensible purpose: one external and on internal.
Nick Mathewson 390e0561 2009-12-22T15:52:02 Fix up behavior of never-defered callbacks a little
Joachim Bauch ea6b1df2 2009-12-08T15:38:34 Only define _GNU_SOURCE if it is not already defined.
Nick Mathewson 438f9ed2 2009-11-23T15:53:24 Add the abilitity to mark some buffer callbacks as never-deferred.
Roman Puls bd6f1bab 2009-12-02T01:15:15 Fix up evthread compilation on windows
Nick Mathewson 347952ff 2009-11-27T15:20:43 Revise the locking API: deprecate the old locking callbacks and add trylock. Previously, there was no good way to request different kinds of lock (say, read/write vs writeonly or recursive vs nonrecursive), or for a lock function to signal failure (which would be important for a trylock mode). This patch revises the lock API to be a bit more useful. The older lock calls are still supported for now. We also add a debugging mode to catch common errors in using the locking APIs.
Nick Mathewson 07e9e9b4 2009-11-20T16:50:55 Parenthesize macro arguments more aggressively
Nick Mathewson f32b5750 2009-11-20T16:38:01 Add a warning about the use of event_initialized.
Niels Provos f1691539 2009-11-19T23:08:50 Remove most calls to event_err() in http and deal with memory errors instead svn:r1555
Nick Mathewson 201d8d0b 2009-11-17T18:29:44 Clarify even more about various system-specific problems with getaddrinfo svn:r1542
Nick Mathewson 86f57420 2009-11-16T22:25:46 Add two implementations of getaddrinfo: one blocking and one nonblocking. The entry points are evutil_getaddrinfo and evdns_getaddrinfo respectively. There are fairly extensive unit tests. I believe this code conforms to RFC3493 pretty closely, but there are probably more issues. It should get tested on more platforms. This code means we can dump the well-intentioned but weirdly-implemented bufferevent_evdns and evutil_resolve code. svn:r1537
Nick Mathewson 72bafc17 2009-11-16T22:23:55 Remove the stupid brokenness where DNS option names needed to end with a colon. svn:r1536
Nick Mathewson ab96b5f3 2009-11-09T18:30:33 Add an option to disable the timeval cache. svn:r1518
Nick Mathewson 693c24ef 2009-11-09T17:16:30 Implement queued timeouts for case where many timeouts are the same. Libevent's current timeout code is relatively optimized for the randomly scattered timeout case, where events are added with their timeouts in no particular order. We add and remove timeouts with O(lg n) behavior. Frequently, however, an application will want to have many timeouts of the same value. For example, we might have 1000 bufferevents, each with a 2 second timeout on reading or writing. If we knew this were always the case, we could just put timeouts in a queue and get O(1) add and remove behavior. Of course, a queue would give O(n) performance for a scattered timeout pattern, so we don't want to just switch the implementation. This patch gives the user the ability to explicitly tag certain timeout values as being "very common". These timeout values have a cookie encoded in the high bits of their tv_usec field to indicate which queue they belong on. The queues themselves are each triggered by an entry in the minheap. See the regress_main.c code for an example use. svn:r1517
Nick Mathewson 25a5e681 2009-11-05T20:37:19 Build fixes for MSVC svn:r1506
Nick Mathewson d14c3b45 2009-11-05T18:25:46 Fix another ssize_t user svn:r1503
Nick Mathewson 47bad8ab 2009-11-04T20:17:32 Implement size limits on HTTP header length and body length. Patch from Constantine Verutin, simplified a little. svn:r1500
Nick Mathewson 0b9eb1bf 2009-11-03T20:40:48 Add a bufferevent function to resolve a name then connect to it. This function, bufferevent_socket_connect_hostname() can either use evdns to do the resolve, or use a new function (evutil_resolve) that uses getaddrinfo or gethostbyname, like http.c does now. This function is meant to eventually replace the hostname resolution mess in http.c. svn:r1496
Nick Mathewson e90e14fb 2009-11-02T16:31:13 Call the bufferevent_flush_mode variable "mode" more consistently in the documentation. Spotted by Alex. svn:r1485
Nick Mathewson 516452b7 2009-10-30T21:08:29 Keep openssl errors associated with the right bufferevent object. OpenSSL has a per-thread error stack, and really doesn't like you leaving errors on the stack. Rather than discard the errors or force the user to handle them, this patch pulls them off the openssl stack and puts them on a stack associated with the bufferevent_openssl. If the user leaves them on the stack then, it won't affect any other connections. This bug was found by Roman Puls. Thanks! svn:r1481
Nick Mathewson e9ee1057 2009-10-27T04:25:45 Give event_assign a return value, and make it less inclined to exit(). We also refactor event_assign so that it is the core function, and event_set() is only the wrapper. svn:r1469
Nick Mathewson a8267663 2009-10-26T19:59:51 API to replace all calls to exit() with a user-supplied fatal-error handler. Also, add unit tests for logging. svn:r1462
Nick Mathewson 879420a7 2009-10-23T22:00:29 Expose a narrow window to the IOCP code. svn:r1459
Nick Mathewson b73ad7bc 2009-10-21T18:48:22 Treat the bitwise OR of two enum values as an int. This makes our interfaces usable from C++, which doesn't believe you can say "bufferevent_socket_nase(base, -1, BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS)" but which instead would demand "static_cast<bufferevent_options>(BEV_OPT_CLOSE_ON_FREE| BEV_OPT_DEFER_CALLBACKS))" for the last argument. Diagnosis and patch from Chris Davis. svn:r1456