-/* $OpenBSD: connection.c,v 1.16 2014/04/20 20:12:31 claudio Exp $ */
+/* $OpenBSD: connection.c,v 1.17 2014/04/21 12:26:50 claudio Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
return;
}
if ((n = pdu_read(c)) == -1) {
+ if (errno == EAGAIN || errno == ENOBUFS ||
+ errno == EINTR) /* try later */
+ return;
+ log_warn("pdu_read");
conn_fsm(c, CONN_EV_FAIL);
return;
}
-/* $OpenBSD: pdu.c,v 1.8 2014/04/20 18:17:12 claudio Exp $ */
+/* $OpenBSD: pdu.c,v 1.9 2014/04/21 12:26:50 claudio Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
}
}
- if ((n = readv(c->fd, iov, niov)) == -1) {
- if (errno == EAGAIN || errno == ENOBUFS ||
- errno == EINTR) /* try later */
- return 0;
- else {
- log_warn("pdu_read");
- return -1;
- }
- }
+ if ((n = readv(c->fd, iov, niov)) == -1)
+ return -1;
if (n == 0)
/* XXX what should we do on close with remaining data? */
return 0;