diff options
-rw-r--r-- | usr.sbin/relayd/relay_http.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/relayd/relay_http.c b/usr.sbin/relayd/relay_http.c index 5b933eb5412..a7925b44c2f 100644 --- a/usr.sbin/relayd/relay_http.c +++ b/usr.sbin/relayd/relay_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay_http.c,v 1.15 2013/06/02 18:02:45 reyk Exp $ */ +/* $OpenBSD: relay_http.c,v 1.16 2013/09/04 22:21:32 bluhm Exp $ */ /* * Copyright (c) 2006 - 2012 Reyk Floeter <reyk@openbsd.org> @@ -324,6 +324,8 @@ relay_read_http(struct bufferevent *bev, void *arg) case HTTP_METHOD_GET: case HTTP_METHOD_HEAD: case HTTP_METHOD_OPTIONS: + cre->toread = 0; + /* FALLTHROUGH */ case HTTP_METHOD_POST: case HTTP_METHOD_PUT: case HTTP_METHOD_RESPONSE: @@ -331,9 +333,8 @@ relay_read_http(struct bufferevent *bev, void *arg) if (cre->toread > 0) bev->readcb = relay_read_httpcontent; - /* Single-pass HTTP response */ - if (cre->dir == RELAY_DIR_RESPONSE && - cre->toread < 0) { + /* Single-pass HTTP body */ + if (cre->toread < 0) { cre->toread = TOREAD_UNLIMITED; bev->readcb = relay_read; } |