summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2011-03-31 19:38:15 +0000
committerstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2011-03-31 19:38:15 +0000
commit28f8c9bce5b4279bf7aa6a7b94812f3b5e806043 (patch)
treee77bad3784456059bca7c9648daefcc03d994adc
parentf87af7497694a0da20d55ab5916331600dc298af (diff)
downloadlighttpd-28f8c9bce5b4279bf7aa6a7b94812f3b5e806043.tar.gz
proxy-backend-http: fix chunked encoding parser
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@2783 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--src/mod_proxy_backend_http.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mod_proxy_backend_http.c b/src/mod_proxy_backend_http.c
index 5bda0658..a56bd602 100644
--- a/src/mod_proxy_backend_http.c
+++ b/src/mod_proxy_backend_http.c
@@ -144,11 +144,11 @@ static handler_t proxy_http_parse_chunked_stream(server *srv, proxy_session *ses
in->bytes_out += (offset - c->offset);
c->offset = offset;
}
+ if ( (size_t)offset == c->mem->used - 1) {
+ break; /* get next chunk from queue */
+ }
+ /* now ch is the last character, and it wasn't an xdigit */
if (!(ch == ' ' || ch == '\r' || ch == ';')) {
- if (ch == '\0') {
- /* get next chunk from queue */
- break;
- }
/* protocol error. bad http-chunk len */
return HANDLER_ERROR;
}