summaryrefslogtreecommitdiffstats
path: root/lib/libevent/evbuffer.c
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2005-04-19 02:03:12 +0000
committerbrad <brad@openbsd.org>2005-04-19 02:03:12 +0000
commitb7cf6bc8c05dd19776838bd8868374ff3d5cf36a (patch)
treea685b19c5e55c4683384f64756942b26e0cfbb27 /lib/libevent/evbuffer.c
parentsend the correct argument, -A not -a (diff)
downloadwireguard-openbsd-b7cf6bc8c05dd19776838bd8868374ff3d5cf36a.tar.xz
wireguard-openbsd-b7cf6bc8c05dd19776838bd8868374ff3d5cf36a.zip
update to libevent 1.0c; keep local changes
Diffstat (limited to 'lib/libevent/evbuffer.c')
-rw-r--r--lib/libevent/evbuffer.c18
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)
{