File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
libraries/ESP8266WebServer/src Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -144,15 +144,16 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
144144 {
145145 // some clients send headers first and data after (like we do)
146146 // give them a chance
147- int tries = 100 ;// 100ms max wait
148- while (!client. available () && tries--) delay ( 1 ) ;
149- size_t newLen = client.available ();
147+ int tries = 1000 ;// 1000ms max wait
148+ size_t newLen ;
149+ while ( !( newLen = client.available ()) && tries--) delay ( 1 );
150150 if (!newLen) break ;
151151 plainBuf = (plainBuf == nullptr ) ? (char *) malloc (newLen + 1 ) : (char *) realloc (plainBuf, plainLen + newLen + 1 );
152152 client.readBytes (&plainBuf[plainLen], newLen);
153153 plainLen += newLen;
154154 plainBuf[plainLen] = ' \0 ' ;
155155 } while (plainLen < contentLength);
156+ if (plainBuf == nullptr ) return false ;
156157#ifdef DEBUG_ESP_HTTP_SERVER
157158 DEBUG_OUTPUT.print (" Plain: " );
158159 DEBUG_OUTPUT.println (plainBuf);
You can’t perform that action at this time.
0 commit comments