aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-07-19 18:23:33 +0200
committerWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-07-19 18:23:33 +0200
commitbdcfe9b02381784ecc06847e0df15585c6ad549a (patch)
tree2c53bea9b04a85bd4e29f171fd5c7e5a039be6f8
parent1f958fc608ea5c468c04d27e0029ae298f920134 (diff)
downloadlitheweb-bdcfe9b02381784ecc06847e0df15585c6ad549a.tar.gz
litheweb-bdcfe9b02381784ecc06847e0df15585c6ad549a.tar.bz2
multipart read EOD signalling fixed
-rw-r--r--picohttp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/picohttp.c b/picohttp.c
index 476630e..7376fa1 100644
--- a/picohttp.c
+++ b/picohttp.c
@@ -1206,12 +1206,16 @@ int picohttpMultipartRead(
* Probably a lot of code would be shared with the ...Getch variant
* and could be placed into a commonly used function.
*/
+ if( mp->finished ) {
+ return -1;
+ }
+
int ch;
size_t i;
for(i = 0; i < len; i++) {
if( 0 > (ch = picohttpMultipartGetch(mp)) ) {
if( mp->finished )
- return 0;
+ return i;
else
return ch;
}