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

httpclient: fix error meaning #7401

Merged
merged 5 commits into from
Jun 25, 2020
Merged

httpclient: fix error meaning #7401

merged 5 commits into from
Jun 25, 2020

Conversation

d-a-v
Copy link
Collaborator

@d-a-v d-a-v commented Jun 23, 2020

Changed HTTPClient error name and log from "Refused" to "Failed" (both macro and string).
"refused" can lead to false assumptions.
"refused" macro is kept for backward compatibility. This is not a breaking change.

update:

A TCP-"connection refused" is an answer from peer telling that there is nothing listening on this tcp port (when a firewall is in the way, the error becomes a timeout error).
But this httpclient error can be returned even when the question cannot be asked because it can be caused by a local error (wifi not connected for example).

For the correct distinction between a local error and a real "connection refused", WiFiClient API has to be updated with an additional function returning the last real error (returned by lwIP (refused, unreachable, ...) or by local hardware (abort, ...)).

@d-a-v d-a-v added this to the 2.7.2 milestone Jun 23, 2020
Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

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

LGTM. I wish there was a way to make a #define deprecated, but I can't seem to find one.

@d-a-v d-a-v merged commit 52f4cc8 into esp8266:master Jun 25, 2020
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.

2 participants