summaryrefslogtreecommitdiff
path: root/lib/libevent/evbuffer.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-04-22 00:56:26 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-04-22 00:56:26 +0000
commit9657663ceec9fe6a3be90c6e4bf3ea973058e65a (patch)
tree671952b73b614f5090d12c04adbb65afd196c12f /lib/libevent/evbuffer.c
parent6ca0465503b5d87bd9dca1cbaadf8de986104de6 (diff)
update to libevent 1.0c; keep local changes
no shared lib so no ABI/API check is necessary thanks to Alexander von Gernler for submitting another diff in an attempt to update libevent and for a use-after-free fix. ok henning@ deraadt@
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 e0cf27202f1..4a2d85303e5 100644
--- a/lib/libevent/evbuffer.c
+++ b/lib/libevent/evbuffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: evbuffer.c,v 1.3 2005/04/19 08:07:45 deraadt Exp $ */
+/* $OpenBSD: evbuffer.c,v 1.4 2005/04/22 00:56:25 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)
{