From 6d290d68051c8921e49d745e274374a36a7f92f8 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Thu, 21 Jan 2016 16:39:12 +0200 Subject: [PATCH] add warning if lwip is missing packets --- src/WebServerClient.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/WebServerClient.cpp b/src/WebServerClient.cpp index eab1619..56ad012 100644 --- a/src/WebServerClient.cpp +++ b/src/WebServerClient.cpp @@ -439,7 +439,10 @@ void AsyncWebServerRequest::_parseMultipartPostByte(uint8_t data, bool last){ _boundaryPosition++; } } else if(_multiParseState == DASH3_OR_RETURN2){ - //os_printf("X:%u:'%c'\n",_contentLength - _parsedLength - 4,data); + if(data == '-' && (_contentLength - _parsedLength - 4) != 0){ + os_printf("ERROR: The parser got to the end of the POST but is expecting % bytes more!\nDrop an issue so we can have more info on the matter!\n", _contentLength - _parsedLength - 4); + _contentLength = _parsedLength + 4;//lets close the request gracefully + } if(data == '\r'){ _multiParseState = EXPECT_FEED2; } else if(data == '-' && _contentLength == (_parsedLength + 4)){