mirror of
https://github.com/arduino-libraries/ArduinoHttpClient.git
synced 2025-04-19 21:22:15 +03:00
Merge pull request #158 from AnCaPepe/AnCaPepe-custom-wait-delay
Add ability to set response wait time
This commit is contained in:
commit
5c5fafb4e8
@ -40,6 +40,7 @@ void HttpClient::resetState()
|
||||
iIsChunked = false;
|
||||
iChunkLength = 0;
|
||||
iHttpResponseTimeout = kHttpResponseTimeout;
|
||||
iHttpWaitForDataDelay = kHttpWaitForDataDelay;
|
||||
}
|
||||
|
||||
void HttpClient::stop()
|
||||
@ -473,7 +474,7 @@ int HttpClient::responseStatusCode()
|
||||
{
|
||||
// We haven't got any data, so let's pause to allow some to
|
||||
// arrive
|
||||
delay(kHttpWaitForDataDelay);
|
||||
delay(iHttpWaitForDataDelay);
|
||||
}
|
||||
}
|
||||
if ( (c == '\n') && (iStatusCode < 200 && iStatusCode != 101) )
|
||||
@ -522,7 +523,7 @@ int HttpClient::skipResponseHeaders()
|
||||
{
|
||||
// We haven't got any data, so let's pause to allow some to
|
||||
// arrive
|
||||
delay(kHttpWaitForDataDelay);
|
||||
delay(iHttpWaitForDataDelay);
|
||||
}
|
||||
}
|
||||
if (endOfHeadersReached())
|
||||
|
@ -317,6 +317,8 @@ public:
|
||||
virtual operator bool() { return bool(iClient); };
|
||||
virtual uint32_t httpResponseTimeout() { return iHttpResponseTimeout; };
|
||||
virtual void setHttpResponseTimeout(uint32_t timeout) { iHttpResponseTimeout = timeout; };
|
||||
virtual uint32_t httpWaitForDataDelay() { return iHttpWaitForDataDelay; };
|
||||
virtual void setHttpWaitForDataDelay(uint32_t delay) { iHttpWaitForDataDelay = delay; };
|
||||
protected:
|
||||
/** Reset internal state data back to the "just initialised" state
|
||||
*/
|
||||
@ -384,6 +386,7 @@ protected:
|
||||
// Stores the value of the current chunk length, if present
|
||||
int iChunkLength;
|
||||
uint32_t iHttpResponseTimeout;
|
||||
uint32_t iHttpWaitForDataDelay;
|
||||
bool iConnectionClose;
|
||||
bool iSendDefaultRequestHeaders;
|
||||
String iHeaderLine;
|
||||
|
Loading…
x
Reference in New Issue
Block a user