diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/httpd/server.c | 16 | ||||
-rw-r--r-- | usr.sbin/httpd/server_file.c | 16 |
2 files changed, 20 insertions, 12 deletions
diff --git a/usr.sbin/httpd/server.c b/usr.sbin/httpd/server.c index e756abb99f9..945ca45fd15 100644 --- a/usr.sbin/httpd/server.c +++ b/usr.sbin/httpd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.42 2014/09/05 10:04:20 reyk Exp $ */ +/* $OpenBSD: server.c,v 1.43 2014/10/02 19:22:43 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org> @@ -771,6 +771,14 @@ server_error(struct bufferevent *bev, short error, void *arg) server_close(clt, "buffer event timeout"); return; } + if (error & EVBUFFER_ERROR) { + if (errno == EFBIG) { + bufferevent_enable(bev, EV_READ); + return; + } + server_close(clt, "buffer event error"); + return; + } if (error & (EVBUFFER_READ|EVBUFFER_WRITE|EVBUFFER_EOF)) { bufferevent_disable(bev, EV_READ|EV_WRITE); @@ -786,11 +794,7 @@ server_error(struct bufferevent *bev, short error, void *arg) server_close(clt, "done"); return; } - if (error & EVBUFFER_ERROR && errno == EFBIG) { - bufferevent_enable(bev, EV_READ); - return; - } - server_close(clt, "buffer event error"); + server_close(clt, "unknown event error"); return; } diff --git a/usr.sbin/httpd/server_file.c b/usr.sbin/httpd/server_file.c index 10fbf4c1bd1..ef337e7ccb1 100644 --- a/usr.sbin/httpd/server_file.c +++ b/usr.sbin/httpd/server_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_file.c,v 1.36 2014/09/27 12:49:45 reyk Exp $ */ +/* $OpenBSD: server_file.c,v 1.37 2014/10/02 19:22:43 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org> @@ -422,6 +422,14 @@ server_file_error(struct bufferevent *bev, short error, void *arg) server_close(clt, "buffer event timeout"); return; } + if (error & EVBUFFER_ERROR) { + if (errno == EFBIG) { + bufferevent_enable(bev, EV_READ); + return; + } + server_close(clt, "buffer event error"); + return; + } if (error & (EVBUFFER_READ|EVBUFFER_WRITE|EVBUFFER_EOF)) { bufferevent_disable(bev, EV_READ|EV_WRITE); @@ -448,10 +456,6 @@ server_file_error(struct bufferevent *bev, short error, void *arg) server_close(clt, "done"); return; } - if (error & EVBUFFER_ERROR && errno == EFBIG) { - bufferevent_enable(bev, EV_READ); - return; - } - server_close(clt, "buffer event error"); + server_close(clt, "unknown event error"); return; } |