o Make the event_base_loop() family of functions respect thread-safety better. This should clear up a few hard-to-debug race conditions.
o Fix a bug when using a specialized memory allocator on win32.
o Have the win32 select() backend label TCP-socket-connected events as EV_WRITE, not EV_READ. This should bring it in line with the other backends, and improve portability. Patch from Christopher Davis.
+ o Stop using enums as arguments or return values when what we mean is a bitfield of enum values. C++ doesn't believe that you can OR two enum values together and get another enum, and C++ takes its typing seriously. Patch from Christopher Davis.
Changes in 2.0.2-alpha:
bufferevent_filter_new(struct bufferevent *underlying,
bufferevent_filter_cb input_filter,
bufferevent_filter_cb output_filter,
- enum bufferevent_options options,
+ int options,
void (*free_context)(void *),
void *ctx)
{
struct bufferevent_filtered *bufev_f;
- enum bufferevent_options tmp_options = options & ~BEV_OPT_THREADSAFE;
+ int tmp_options = options & ~BEV_OPT_THREADSAFE;
if (!input_filter)
input_filter = be_null_filter;
evutil_socket_t fd,
SSL *ssl,
enum bufferevent_ssl_state state,
- enum bufferevent_options options)
+ int options)
{
struct bufferevent_openssl *bev_ssl = NULL;
struct bufferevent_private *bev_p = NULL;
- enum bufferevent_options tmp_options = options & ~BEV_OPT_THREADSAFE;
+ int tmp_options = options & ~BEV_OPT_THREADSAFE;
if (underlying != NULL && fd >= 0)
return NULL; /* Only one can be set. */
struct bufferevent *underlying,
SSL *ssl,
enum bufferevent_ssl_state state,
- enum bufferevent_options options)
+ int options)
{
int close_flag = options & BEV_OPT_CLOSE_ON_FREE;
BIO *bio;
evutil_socket_t fd,
SSL *ssl,
enum bufferevent_ssl_state state,
- enum bufferevent_options options)
+ int options)
{
/* Does the SSL already have an fd? */
BIO *bio = SSL_get_wbio(ssl);
static struct bufferevent_pair *
bufferevent_pair_elt_new(struct event_base *base,
- enum bufferevent_options options)
+ int options)
{
struct bufferevent_pair *bufev;
if (! (bufev = mm_calloc(1, sizeof(struct bufferevent_pair))))
}
int
-bufferevent_pair_new(struct event_base *base, enum bufferevent_options options,
+bufferevent_pair_new(struct event_base *base, int options,
struct bufferevent *pair[2])
{
struct bufferevent_pair *bufev1 = NULL, *bufev2 = NULL;
- enum bufferevent_options tmp_options;
+ int tmp_options;
options |= BEV_OPT_DEFER_CALLBACKS;
tmp_options = options & ~BEV_OPT_THREADSAFE;
struct bufferevent *
bufferevent_socket_new(struct event_base *base, evutil_socket_t fd,
- enum bufferevent_options options)
+ int options)
{
struct bufferevent_private *bufev_p;
struct bufferevent *bufev;
return (getenv(environment) != NULL);
}
-enum event_method_feature
+int
event_base_get_features(struct event_base *base)
{
return base->evsel->features;
int
-event_config_set_flag(struct event_config *cfg,
- enum event_base_config_flag flag)
+event_config_set_flag(struct event_config *cfg, int flag)
{
if (!cfg)
return -1;
int
event_config_require_features(struct event_config *cfg,
- enum event_method_feature features)
+ int features)
{
if (!cfg)
return (-1);
error occurred
@see bufferevent_free()
*/
-struct bufferevent *bufferevent_socket_new(struct event_base *base, evutil_socket_t fd, enum bufferevent_options options);
+struct bufferevent *bufferevent_socket_new(struct event_base *base, evutil_socket_t fd, int options);
/**
Launch a connect() attempt with a socket. When the connect succeeds,
bufferevent_filter_new(struct bufferevent *underlying,
bufferevent_filter_cb input_filter,
bufferevent_filter_cb output_filter,
- enum bufferevent_options options,
+ int options,
void (*free_context)(void *),
void *ctx);
@return 0 on success, -1 on failure.
*/
int
-bufferevent_pair_new(struct event_base *base, enum bufferevent_options options,
+bufferevent_pair_new(struct event_base *base, int options,
struct bufferevent *pair[2]);
#ifdef __cplusplus
struct bufferevent *underlying,
struct ssl_st *ssl,
enum bufferevent_ssl_state state,
- enum bufferevent_options options);
+ int options);
struct bufferevent *
bufferevent_openssl_socket_new(struct event_base *base,
evutil_socket_t fd,
struct ssl_st *ssl,
enum bufferevent_ssl_state state,
- enum bufferevent_options options);
+ int options);
struct ssl_st *
bufferevent_openssl_get_ssl(struct bufferevent *bufev);
/**
Return a bitmask of the features implemented by an event base.
*/
-enum event_method_feature event_base_get_features(struct event_base *base);
+int event_base_get_features(struct event_base *base);
/**
Enters a required event method feature that the application demands.
Replaces values from previous calls to this function.
@return 0 on success, -1 on failure.
*/
-int event_config_require_features(struct event_config *cfg,
- enum event_method_feature feature);
+int event_config_require_features(struct event_config *cfg, int feature);
/** Sets a flag to configure what parts of the eventual event_base will
* be initialized, and how they'll work. */
-int event_config_set_flag(struct event_config *cfg,
- enum event_base_config_flag flag);
+int event_config_set_flag(struct event_config *cfg, int flag);
/**
Initialize the event API.