diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-04-19 02:03:13 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-04-19 02:03:13 +0000 |
commit | f45ba297f3f3071fe8a52f3dd714c97d91163377 (patch) | |
tree | f69b5fff5198ef625dea9ca456fe6c2abfc09115 /lib/libevent/evbuffer.c | |
parent | 2b7f6b45c2a1461e8f2e293123679d04a73cca1a (diff) |
update to libevent 1.0c; keep local changes
Diffstat (limited to 'lib/libevent/evbuffer.c')
-rw-r--r-- | lib/libevent/evbuffer.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/libevent/evbuffer.c b/lib/libevent/evbuffer.c index 453edff08cd..4a3354d9f2c 100644 --- a/lib/libevent/evbuffer.c +++ b/lib/libevent/evbuffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evbuffer.c,v 1.1 2004/04/28 06:53:12 brad Exp $ */ +/* $OpenBSD: evbuffer.c,v 1.2 2005/04/19 02:03:12 brad Exp $ */ /* * Copyright (c) 2002-2004 Niels Provos <provos@citi.umich.edu> @@ -37,7 +37,6 @@ #include <sys/time.h> #endif -#include <err.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -152,7 +151,9 @@ bufferevent_writecb(int fd, short event, void *arg) if (EVBUFFER_LENGTH(bufev->output)) { res = evbuffer_write(bufev->output, fd); if (res == -1) { - if (errno == EAGAIN || errno == EINTR) + if (errno == EAGAIN || + errno == EINTR || + errno == EINPROGRESS) goto reschedule; /* error case */ what |= EVBUFFER_ERROR; @@ -227,6 +228,17 @@ bufferevent_new(int fd, evbuffercb readcb, evbuffercb writecb, return (bufev); } +int +bufferevent_priority_set(struct bufferevent *bufev, int priority) +{ + if (event_priority_set(&bufev->ev_read, priority) == -1) + return (-1); + if (event_priority_set(&bufev->ev_write, priority) == -1) + return (-1); + + return (0); +} + void bufferevent_free(struct bufferevent *bufev) { |