diff --git a/Sming/Components/Network/src/Network/Http/HttpClientConnection.cpp b/Sming/Components/Network/src/Network/Http/HttpClientConnection.cpp index d939bfb915..28d08b6042 100644 --- a/Sming/Components/Network/src/Network/Http/HttpClientConnection.cpp +++ b/Sming/Components/Network/src/Network/Http/HttpClientConnection.cpp @@ -61,6 +61,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.peek(); diff --git a/Sming/Components/Network/src/Network/Http/HttpClientConnection.h b/Sming/Components/Network/src/Network/Http/HttpClientConnection.h index 2720594f6a..43f590179c 100644 --- a/Sming/Components/Network/src/Network/Http/HttpClientConnection.h +++ b/Sming/Components/Network/src/Network/Http/HttpClientConnection.h @@ -68,6 +68,7 @@ class HttpClientConnection : public HttpConnection // TCP methods void onReadyToSendData(TcpConnectionEvent sourceEvent) override; + void onError(err_t err) override; void onClosed() override;