summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-09-19 21:04:55 +0200
committerLars-Dominik Braun <lars@6xq.net>2011-11-09 20:10:03 +0100
commitb0c03a60fa6438f10e8cf74cac482243a7938990 (patch)
tree9fb3ed5867eb668086c29365779ef1efff035361
parent747c48162c983eca0c97767bef1803cf09675935 (diff)
downloadpianobar-b0c03a60fa6438f10e8cf74cac482243a7938990.tar.gz
pianobar-b0c03a60fa6438f10e8cf74cac482243a7938990.tar.bz2
pianobar-b0c03a60fa6438f10e8cf74cac482243a7938990.zip
waitress: fix chunked handler return values
-rw-r--r--src/libwaitress/waitress.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libwaitress/waitress.c b/src/libwaitress/waitress.c
index 705d8dc..2101e2a 100644
--- a/src/libwaitress/waitress.c
+++ b/src/libwaitress/waitress.c
@@ -535,12 +535,18 @@ static WaitressHandlerReturn_t WaitressHandleChunked (WaitressHandle_t *waith,
size_t remaining = size-(content-buf);
if (remaining >= waith->request.chunkSize) {
- WaitressHandleIdentity (waith, content, waith->request.chunkSize);
+ if (WaitressHandleIdentity (waith, content,
+ waith->request.chunkSize) == WAITRESS_HANDLER_ABORTED) {
+ return WAITRESS_HANDLER_ABORTED;
+ }
/* FIXME: skip trailing \r\n */
content += waith->request.chunkSize+2;
waith->request.chunkSize = 0;
} else {
- WaitressHandleIdentity (waith, content, remaining);
+ if (WaitressHandleIdentity (waith, content, remaining) ==
+ WAITRESS_HANDLER_ABORTED) {
+ return WAITRESS_HANDLER_ABORTED;
+ }
waith->request.chunkSize -= remaining;
return WAITRESS_HANDLER_CONTINUE;
}
@@ -557,11 +563,12 @@ static WaitressHandlerReturn_t WaitressHandleChunked (WaitressHandle_t *waith,
content = nextContent;
}
} else {
- return WAITRESS_HANDLER_CONTINUE;
+ return WAITRESS_HANDLER_ERR;
}
}
- return WAITRESS_HANDLER_CONTINUE;
+ assert (0);
+ return WAITRESS_HANDLER_ERR;
}
/* handle http header