diff --git a/Sming/Components/Network/src/Network/Http/HttpClientConnection.cpp b/Sming/Components/Network/src/Network/Http/HttpClientConnection.cpp index 82f49b1b25..1cb1d05c70 100644 --- a/Sming/Components/Network/src/Network/Http/HttpClientConnection.cpp +++ b/Sming/Components/Network/src/Network/Http/HttpClientConnection.cpp @@ -61,11 +61,11 @@ void HttpClientConnection::reset() HttpConnection::reset(); } -void HttpClientConnection::onError(err_t err) +bool HttpClientConnection::onHttpError(HttpError error) { - HttpConnection::onError(err); + bool res = HttpConnection::onHttpError(error); - auto request = waitingQueue.peek(); + auto request = executionQueue.peek(); if(request != nullptr) { auto callback = request->requestCompletedDelegate; @@ -73,6 +73,8 @@ void HttpClientConnection::onError(err_t err) callback(*this, false); } } + + return res; } int HttpClientConnection::onMessageBegin(http_parser* parser) diff --git a/Sming/Components/Network/src/Network/Http/HttpClientConnection.h b/Sming/Components/Network/src/Network/Http/HttpClientConnection.h index 43f590179c..1e2c4a1243 100644 --- a/Sming/Components/Network/src/Network/Http/HttpClientConnection.h +++ b/Sming/Components/Network/src/Network/Http/HttpClientConnection.h @@ -59,6 +59,9 @@ class HttpClientConnection : public HttpConnection } protected: + // HttpConnection methods + bool onHttpError(HttpError error) override; + // HTTP parser methods int onMessageBegin(http_parser* parser) override; @@ -68,7 +71,6 @@ class HttpClientConnection : public HttpConnection // TCP methods void onReadyToSendData(TcpConnectionEvent sourceEvent) override; - void onError(err_t err) override; void onClosed() override;