Skip to content

Commit 1c3225f

Browse files
author
Me No Dev
committed
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
1 parent 1031e26 commit 1c3225f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/ESP8266WebServer/src/Parsing.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
108108

109109
if (!isForm){
110110
if (searchStr != "") searchStr += '&';
111+
//some clients send headers first and data after (like we do)
112+
//give them a chance
113+
int tries = 100;//100ms max wait
114+
while(!client.available() && tries--)delay(1);
111115
size_t plainLen = client.available();
112116
char *plainBuf = (char*)malloc(plainLen+1);
113117
client.readBytes(plainBuf, plainLen);

0 commit comments

Comments
 (0)