Skip to content

Commit

Permalink
post body might not be sent with the headers
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Me No Dev committed Jul 16, 2015
1 parent 1031e26 commit 1c3225f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/ESP8266WebServer/src/Parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1c3225f

Please sign in to comment.