Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add http client configurable timeout usefull when download is slow on server side #4705

Merged

Conversation

marian-craciunescu
Copy link
Contributor

This Pull request fixes #1676 referenced on openenergymonitor/EmonESP#3 (fix stream error).

@marian-craciunescu
Copy link
Contributor Author

@igrr @me-no-dev @d-a-v can you provide some feedback

Copy link
Collaborator

@d-a-v d-a-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity how much do you use ?

@marian-craciunescu
Copy link
Contributor Author

@d-a-v I've put it to 30s since the wifi router signal is quite bad at my place.


ESP8266HTTPUpdate::ESP8266HTTPUpdate(int httpClientTimeout)
{
this->_http_client_timeout = httpClientTimeout;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use constructor body for member init. Instead:

ESP8266HTTPUpdate::ESP8266HTTPUpdate(int httpClientTimeout)
    : _http_client_timeout(httpClientTimeout)
{}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.thank you

@@ -103,6 +104,8 @@ class ESP8266HTTPUpdate

int _lastError;
bool _rebootOnUpdate = true;
private:
int _http_client_timeout;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use camelCase.

@devyte devyte merged commit bd87970 into esp8266:master May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[httpUpdate] Update.writeStream failed! (ERROR[6]: Stream Read Timeout)
3 participants