File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ void HttpClient::resetState()
48
48
iContentLength = 0 ;
49
49
iBodyLengthConsumed = 0 ;
50
50
iContentLengthPtr = 0 ;
51
+ iHttpResponseTimeout = kHttpResponseTimeout ;
51
52
}
52
53
53
54
void HttpClient::stop ()
@@ -311,7 +312,7 @@ int HttpClient::responseStatusCode()
311
312
const char * statusPtr = statusPrefix;
312
313
// Whilst we haven't timed out & haven't reached the end of the headers
313
314
while ((c != ' \n ' ) &&
314
- ( (millis () - timeoutStart) < kHttpResponseTimeout ))
315
+ ( (millis () - timeoutStart) < iHttpResponseTimeout ))
315
316
{
316
317
if (available ())
317
318
{
@@ -401,7 +402,7 @@ int HttpClient::skipResponseHeaders()
401
402
unsigned long timeoutStart = millis ();
402
403
// Whilst we haven't timed out & haven't reached the end of the headers
403
404
while ((!endOfHeadersReached ()) &&
404
- ( (millis () - timeoutStart) < kHttpResponseTimeout ))
405
+ ( (millis () - timeoutStart) < iHttpResponseTimeout ))
405
406
{
406
407
if (available ())
407
408
{
Original file line number Diff line number Diff line change @@ -372,6 +372,8 @@ class HttpClient : public Client
372
372
virtual void stop ();
373
373
virtual uint8_t connected () { return iClient->connected (); };
374
374
virtual operator bool () { return bool (iClient); };
375
+ virtual uint32_t httpResponseTimeout () { return iHttpResponseTimeout; };
376
+ virtual void setHttpResponseTimeout (uint32_t timeout) { iHttpResponseTimeout = timeout; };
375
377
protected:
376
378
/* * Reset internal state data back to the "just initialised" state
377
379
*/
@@ -434,6 +436,7 @@ class HttpClient : public Client
434
436
// Address of the proxy to use, if we're using one
435
437
IPAddress iProxyAddress;
436
438
uint16_t iProxyPort;
439
+ uint32_t iHttpResponseTimeout;
437
440
};
438
441
439
442
#endif
You can’t perform that action at this time.
0 commit comments