File tree 1 file changed +4
-3
lines changed
libraries/ESP8266WebServer/src
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) {
144
144
{
145
145
// some clients send headers first and data after (like we do)
146
146
// 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 );
150
150
if (!newLen) break ;
151
151
plainBuf = (plainBuf == nullptr ) ? (char *) malloc (newLen + 1 ) : (char *) realloc (plainBuf, plainLen + newLen + 1 );
152
152
client.readBytes (&plainBuf[plainLen], newLen);
153
153
plainLen += newLen;
154
154
plainBuf[plainLen] = ' \0 ' ;
155
155
} while (plainLen < contentLength);
156
+ if (plainBuf == nullptr ) return false ;
156
157
#ifdef DEBUG_ESP_HTTP_SERVER
157
158
DEBUG_OUTPUT.print (" Plain: " );
158
159
DEBUG_OUTPUT.println (plainBuf);
You can’t perform that action at this time.
0 commit comments