aboutsummaryrefslogtreecommitdiff
path: root/picohttp.c
diff options
context:
space:
mode:
Diffstat (limited to 'picohttp.c')
-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;
}