From 892b09f545f8eca4fbed5d11b6763aa3673e2f85 Mon Sep 17 00:00:00 2001 From: Andreas Drewke Date: Wed, 13 Dec 2023 12:00:46 +0100 Subject: [PATCH] overall: synced some MiniScript fixes into tdme2 --- src/tdme/network/httpclient/HTTPClient.cpp | 2 +- src/tdme/network/httpclient/HTTPDownloadClient.cpp | 2 +- src/tdme/os/network/SecureTCPSocket.cpp | 2 -- src/tdme/os/network/SecureTCPSocket.h | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/tdme/network/httpclient/HTTPClient.cpp b/src/tdme/network/httpclient/HTTPClient.cpp index b766124b2..66569e068 100644 --- a/src/tdme/network/httpclient/HTTPClient.cpp +++ b/src/tdme/network/httpclient/HTTPClient.cpp @@ -227,7 +227,7 @@ void HTTPClient::execute() { // socket->shutdown(); } catch (Exception& exception) { - socket->shutdown(); + if (socket != nullptr) socket->shutdown(); // Console::println(string("HTTPClient::execute(): performed HTTP request: FAILED: ") + exception.what()); // rethrow diff --git a/src/tdme/network/httpclient/HTTPDownloadClient.cpp b/src/tdme/network/httpclient/HTTPDownloadClient.cpp index 9798e99b5..6d741f921 100644 --- a/src/tdme/network/httpclient/HTTPDownloadClient.cpp +++ b/src/tdme/network/httpclient/HTTPDownloadClient.cpp @@ -318,7 +318,7 @@ void HTTPDownloadClient::start() { downloadClient->finished = true; downloadClient->progress = 1.0f; } catch (Exception& exception) { - socket->shutdown(); + if (socket != nullptr) socket->shutdown(); downloadClient->finished = true; Console::println(string("HTTPDownloadClient::execute(): performed HTTP request: FAILED: ") + exception.what()); } diff --git a/src/tdme/os/network/SecureTCPSocket.cpp b/src/tdme/os/network/SecureTCPSocket.cpp index f245d2dda..cae9d1bdc 100644 --- a/src/tdme/os/network/SecureTCPSocket.cpp +++ b/src/tdme/os/network/SecureTCPSocket.cpp @@ -7,8 +7,6 @@ #include #include #include -#include -#include #ifndef OPENSSL_NO_CT #include #endif diff --git a/src/tdme/os/network/SecureTCPSocket.h b/src/tdme/os/network/SecureTCPSocket.h index 35b71c638..3443e314b 100644 --- a/src/tdme/os/network/SecureTCPSocket.h +++ b/src/tdme/os/network/SecureTCPSocket.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include