diff --git a/Sming/Core/Network/Http/HttpClientConnection.cpp b/Sming/Core/Network/Http/HttpClientConnection.cpp index a42da1655a..1e03b4f21a 100644 --- a/Sming/Core/Network/Http/HttpClientConnection.cpp +++ b/Sming/Core/Network/Http/HttpClientConnection.cpp @@ -75,6 +75,20 @@ void HttpClientConnection::reset() HttpConnection::reset(); } +void HttpClientConnection::onError(err_t err) +{ + HttpConnection::onError(err); + + auto request = waitingQueue.peek(); + + if(request != nullptr) { + auto callback = request->requestCompletedDelegate; + if(callback) { + callback(*this, false); + } + } +} + int HttpClientConnection::onMessageBegin(http_parser* parser) { incomingRequest = executionQueue.dequeue(); diff --git a/Sming/Core/Network/Http/HttpClientConnection.h b/Sming/Core/Network/Http/HttpClientConnection.h index 60d2eef9c2..fb70b55044 100644 --- a/Sming/Core/Network/Http/HttpClientConnection.h +++ b/Sming/Core/Network/Http/HttpClientConnection.h @@ -66,6 +66,7 @@ class HttpClientConnection : public HttpConnection // TCP methods void onReadyToSendData(TcpConnectionEvent sourceEvent) override; + void onError(err_t err) override; void cleanup() override;