summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/ioev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/ioev.c b/usr.sbin/smtpd/ioev.c
index 69e9c93ce8e..3f66fc6667b 100644
--- a/usr.sbin/smtpd/ioev.c
+++ b/usr.sbin/smtpd/ioev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioev.c,v 1.6 2012/10/10 19:38:04 eric Exp $ */
+/* $OpenBSD: ioev.c,v 1.7 2012/10/25 18:14:24 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -542,8 +542,10 @@ io_dispatch(int fd, short ev, void *humppa)
if (ev & EV_WRITE && (w = io_queued(io))) {
if ((n = iobuf_write(io->iobuf, io->sock)) < 0) {
- if (n == IO_ERROR)
+ if (n == IOBUF_ERROR || n == IOBUF_WANT_WRITE)
log_warn("io_dispatch: iobuf_write");
+ if (n == IOBUF_WANT_WRITE) /* kqueue bug? */
+ goto read;
io_callback(io, n == IOBUF_CLOSED ?
IO_DISCONNECTED : IO_ERROR);
goto leave;
@@ -551,6 +553,7 @@ io_dispatch(int fd, short ev, void *humppa)
if (w > io->lowat && w - n <= io->lowat)
io_callback(io, IO_LOWAT);
}
+ read:
if (ev & EV_READ) {
if ((n = iobuf_read(io->iobuf, io->sock)) < 0) {