o Add a new evbuffer_peek() interface to inspect data in an evbuffer without removing it.
o Fix a deadlock when suspending reads in a bufferevent due to a full buffer. (Spotted by Joachim Bauch.)
o Fix a memory error when freeing a thread-enabled event base with registered events. (Spotted by Joachim Bauch.)
+ o Try to contain degree of failure when running on a win32 version so heavily firewalled that we can't fake a socketpair.
+
Changes in 2.0.1-alpha:
o free minheap on event_base_free(); from Christopher Layne
struct win_fd_set *readset_out;
struct win_fd_set *writeset_out;
struct win_fd_set *exset_out;
+ unsigned signals_are_broken : 1;
};
static void *win32_init (struct event_base *);
winop->readset_out->fd_count = winop->writeset_out->fd_count
= winop->exset_out->fd_count = 0;
- evsig_init(_base);
+ if (evsig_init(_base) < 0)
+ winop->signals_are_broken = 1;
return (winop);
err:
struct win32op *win32op = base->evbase;
struct idx_info *idx = _idx;
+ if ((events & EV_SIGNAL) && win32op->signals_are_broken)
+ return (-1);
+
if (!(events & (EV_READ|EV_WRITE)))
return (0);
#endif
int sh_old_max;
};
-void evsig_init(struct event_base *);
+int evsig_init(struct event_base *);
void evsig_process(struct event_base *);
void evsig_dealloc(struct event_base *);
#define FD_CLOSEONEXEC(x)
#endif
-void
+int
evsig_init(struct event_base *base)
{
/*
* signals that got delivered.
*/
if (evutil_socketpair(
- AF_UNIX, SOCK_STREAM, 0, base->sig.ev_signal_pair) == -1)
+ AF_UNIX, SOCK_STREAM, 0, base->sig.ev_signal_pair) == -1) {
+#ifdef WIN32
+ /* Make this nonfatal on win32, where sometimes people
+ have localhost firewalled. */
+ event_sock_warn(1, -1, "%s: socketpair", __func__);
+#else
event_sock_err(1, -1, "%s: socketpair", __func__);
+#endif
+ return -1;
+ }
FD_CLOSEONEXEC(base->sig.ev_signal_pair[0]);
FD_CLOSEONEXEC(base->sig.ev_signal_pair[1]);
base->evsigsel = &evsigops;
base->evsigbase = &base->sig;
+
+ return 0;
}
/* Helper: set the signal handler for evsignal to handler in base, so that