From bdcfe9b02381784ecc06847e0df15585c6ad549a Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Fri, 19 Jul 2013 18:23:33 +0200 Subject: multipart read EOD signalling fixed --- picohttp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3