diff options
| author | Mike Skec <skec@protonmail.ch> | 2021-02-18 18:40:46 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-02-18 11:23:23 +0100 |
| commit | 415a5bd7b8288316b52338f359f5cd1280eff0bd (patch) | |
| tree | 4c6d51c428eadcd01a52ed869987c1634e8cd300 /src/protocols | |
| parent | 6e127eb49d6a71e4d05cbb2e29fc164e718a903c (diff) | |
Continuation of #134
Diffstat (limited to 'src/protocols')
| -rw-r--r-- | src/protocols/fingerclient.cpp | 5 | ||||
| -rw-r--r-- | src/protocols/geminiclient.cpp | 11 | ||||
| -rw-r--r-- | src/protocols/gopherclient.cpp | 4 |
3 files changed, 13 insertions, 7 deletions
diff --git a/src/protocols/fingerclient.cpp b/src/protocols/fingerclient.cpp index ee62ce1..e7b6c0d 100644 --- a/src/protocols/fingerclient.cpp +++ b/src/protocols/fingerclient.cpp @@ -94,5 +94,10 @@ void FingerClient::on_finished() void FingerClient::on_socketError(QAbstractSocket::SocketError error_code) { + // Same as GopherClient::on_SocketError. See there for explanation + if (error_code == QAbstractSocket::RemoteHostClosedError) { + socket.close(); + return; + } this->emitNetworkError(error_code, socket.errorString()); } diff --git a/src/protocols/geminiclient.cpp b/src/protocols/geminiclient.cpp index 30b4e0f..30c79ac 100644 --- a/src/protocols/geminiclient.cpp +++ b/src/protocols/geminiclient.cpp @@ -391,10 +391,11 @@ void GeminiClient::socketError(QAbstractSocket::SocketError socketError) // state and we know the TLS connection has ended. if(socketError == QAbstractSocket::RemoteHostClosedError) { socket.close(); - } else { - this->is_error_state = true; - if(not this->suppress_socket_tls_error) { - this->emitNetworkError(socketError, socket.errorString()); - } + return; + } + + this->is_error_state = true; + if(not this->suppress_socket_tls_error) { + this->emitNetworkError(socketError, socket.errorString()); } } diff --git a/src/protocols/gopherclient.cpp b/src/protocols/gopherclient.cpp index a55ae0c..4af6605 100644 --- a/src/protocols/gopherclient.cpp +++ b/src/protocols/gopherclient.cpp @@ -127,8 +127,8 @@ void GopherClient::on_socketError(QAbstractSocket::SocketError error_code) // This is more sane then erroring out here as it's a perfectly legal // state and we know the connection has ended. if (error_code == QAbstractSocket::RemoteHostClosedError) { + socket.close(); return; - } else { - this->emitNetworkError(error_code, socket.errorString()); } + this->emitNetworkError(error_code, socket.errorString()); } |
