File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -345,23 +345,25 @@ void WebServer::_uploadWriteByte(uint8_t b) {
345
345
346
346
int WebServer::_uploadReadByte (NetworkClient &client) {
347
347
int res = client.read ();
348
-
348
+
349
349
if (res < 0 ) {
350
350
// keep trying until you either read a valid byte or timeout
351
351
const unsigned long startMillis = millis ();
352
352
const long timeoutIntervalMillis = client.getTimeout ();
353
353
bool timedOut = false ;
354
- for (;;) {
355
- if (!client.connected ()) return -1 ;
354
+ for (;;) {
355
+ if (!client.connected ()) {
356
+ return -1 ;
357
+ }
356
358
// loosely modeled after blinkWithoutDelay pattern
357
- while (!timedOut && !client.available () && client.connected ()){
359
+ while (!timedOut && !client.available () && client.connected ()) {
358
360
delay (2 );
359
361
timedOut = (millis () - startMillis) >= timeoutIntervalMillis;
360
362
}
361
363
362
364
res = client.read ();
363
- if (res >= 0 ) {
364
- return res; // exit on a valid read
365
+ if (res >= 0 ) {
366
+ return res; // exit on a valid read
365
367
}
366
368
// NOTE: it is possible to get here and have all of the following
367
369
// assertions hold true
@@ -377,7 +379,7 @@ int WebServer::_uploadReadByte(NetworkClient &client) {
377
379
378
380
timedOut = (millis () - startMillis) >= timeoutIntervalMillis;
379
381
if (timedOut) {
380
- return res; // exit on a timeout
382
+ return res; // exit on a timeout
381
383
}
382
384
}
383
385
}
You can’t perform that action at this time.
0 commit comments