httpclient: fix error meaning by d-a-v · Pull Request #7401 · esp8266/Arduino (original) (raw)
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, ...)).