From 999b673927bc94ac7a8b8f8efffbf2a7e1e09044 Mon Sep 17 00:00:00 2001 From: Samuel Jackson <samueljackson@outlook.com> Date: Wed, 27 Sep 2017 18:15:01 +0100 Subject: [PATCH] Remove pointer entirely and update comment There is no longer a need to do this as the bug was present in Poco <1.4. Since we now require a minimum of >=1.4 we can pass the socket normally. --- Framework/ICat/src/CatalogDownloadDataFiles.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Framework/ICat/src/CatalogDownloadDataFiles.cpp b/Framework/ICat/src/CatalogDownloadDataFiles.cpp index 8f3c16b4e53..a24e8f0d47b 100644 --- a/Framework/ICat/src/CatalogDownloadDataFiles.cpp +++ b/Framework/ICat/src/CatalogDownloadDataFiles.cpp @@ -164,8 +164,8 @@ std::string CatalogDownloadDataFiles::doDownloadandSavetoLocalDrive( nullptr, certificateHandler, context); // Session takes ownership of socket - auto socket = Kernel::make_unique<Poco::Net::SecureStreamSocket>(context); - Poco::Net::HTTPSClientSession session(*socket); + Poco::Net::SecureStreamSocket socket{context}; + Poco::Net::HTTPSClientSession session{socket}; session.setHost(uri.getHost()); session.setPort(uri.getPort()); @@ -213,12 +213,6 @@ std::string CatalogDownloadDataFiles::doDownloadandSavetoLocalDrive( // I have opted to catch the exception and do nothing as this allows the // load/download functionality to work. // However, the port the user used to download the file will be left open. - // - // In addition, there's a crash when destructing SecureSocketImpl (internal to - // SecureSocketStream, which is - // created and destroyed by HTTPSClientSession). We avoid that crash by - // instantiating SecureSocketStream - // ourselves and passing it to the HTTPSClientSession, which takes ownership. catch (Poco::Exception &error) { throw std::runtime_error(error.displayText()); } -- GitLab