Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Connected bug #3

Merged
merged 2 commits into from

3 participants

John McKerrell Alexander Dean Adrian McEwen
John McKerrell

Fix for the connected() bug

Alexander Dean

/nudge. Can we get this fixed please?

Adrian McEwen amcewen merged commit ce4d50b into from
Adrian McEwen
Owner

Thanks for that - sorry it took a while to get it merged in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 1, 2012
  1. John McKerrell
Commits on Nov 2, 2012
  1. John McKerrell
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 3 deletions.
  1. +3 −2 HttpClient.cpp
  2. +4 −1 HttpClient.h
5 HttpClient.cpp
View
@@ -48,6 +48,7 @@ void HttpClient::resetState()
iContentLength = 0;
iBodyLengthConsumed = 0;
iContentLengthPtr = 0;
+ iHttpResponseTimeout = kHttpResponseTimeout;
}
void HttpClient::stop()
@@ -311,7 +312,7 @@ int HttpClient::responseStatusCode()
const char* statusPtr = statusPrefix;
// Whilst we haven't timed out & haven't reached the end of the headers
while ((c != '\n') &&
- ( (millis() - timeoutStart) < kHttpResponseTimeout ))
+ ( (millis() - timeoutStart) < iHttpResponseTimeout ))
{
if (available())
{
@@ -401,7 +402,7 @@ int HttpClient::skipResponseHeaders()
unsigned long timeoutStart = millis();
// Whilst we haven't timed out & haven't reached the end of the headers
while ((!endOfHeadersReached()) &&
- ( (millis() - timeoutStart) < kHttpResponseTimeout ))
+ ( (millis() - timeoutStart) < iHttpResponseTimeout ))
{
if (available())
{
5 HttpClient.h
View
@@ -370,8 +370,10 @@ class HttpClient : public Client
virtual int connect(IPAddress ip, uint16_t port) { return iClient->connect(ip, port); };
virtual int connect(const char *host, uint16_t port) { return iClient->connect(host, port); };
virtual void stop();
- virtual uint8_t connected() { iClient->connected(); };
+ virtual uint8_t connected() { return iClient->connected(); };
virtual operator bool() { return bool(iClient); };
+ virtual uint32_t httpResponseTimeout() { return iHttpResponseTimeout; };
+ virtual void setHttpResponseTimeout(uint32_t timeout) { iHttpResponseTimeout = timeout; };
protected:
/** Reset internal state data back to the "just initialised" state
*/
@@ -434,6 +436,7 @@ class HttpClient : public Client
// Address of the proxy to use, if we're using one
IPAddress iProxyAddress;
uint16_t iProxyPort;
+ uint32_t iHttpResponseTimeout;
};
#endif
Something went wrong with that request. Please try again.