From 1c3225f38797e1336d1bbdb8b24e3e1f6a0ab689 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Thu, 16 Jul 2015 23:56:36 +0300 Subject: [PATCH] post body might not be sent with the headers since optimistic_yield() was implemented, at this point we might not have the body yet, so we should give it a chance to be sent and put in the buffer --- libraries/ESP8266WebServer/src/Parsing.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/ESP8266WebServer/src/Parsing.cpp b/libraries/ESP8266WebServer/src/Parsing.cpp index e47be4386..682839d13 100644 --- a/libraries/ESP8266WebServer/src/Parsing.cpp +++ b/libraries/ESP8266WebServer/src/Parsing.cpp @@ -108,6 +108,10 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) { if (!isForm){ if (searchStr != "") searchStr += '&'; + //some clients send headers first and data after (like we do) + //give them a chance + int tries = 100;//100ms max wait + while(!client.available() && tries--)delay(1); size_t plainLen = client.available(); char *plainBuf = (char*)malloc(plainLen+1); client.readBytes(plainBuf, plainLen);