From b45980f0f6d734d37fe5d28cf73f06235b7660f3 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Wed, 29 Apr 2020 11:53:23 -0700 Subject: [PATCH] (http client) better current request cancellation support when the HttpClient destructor is invoked (see #189) --- docs/CHANGELOG.md | 4 ++++ ixwebsocket/IXHttpClient.cpp | 5 ++--- ixwebsocket/IXWebSocketVersion.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index bc237299..6eea18f3 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All changes to this project will be documented in this file. +## [9.5.3] - 2020-04-29 + +(http client) better current request cancellation support when the HttpClient destructor is invoked (see #189) + ## [9.5.2] - 2020-04-27 (cmake) fix cmake broken tls option parsing diff --git a/ixwebsocket/IXHttpClient.cpp b/ixwebsocket/IXHttpClient.cpp index b04c69d2..1a2666bb 100644 --- a/ixwebsocket/IXHttpClient.cpp +++ b/ixwebsocket/IXHttpClient.cpp @@ -220,11 +220,10 @@ namespace ix std::string req(ss.str()); std::string errMsg; - std::atomic requestInitCancellation(false); // Make a cancellation object dealing with connection timeout auto isCancellationRequested = - makeCancellationRequestWithTimeout(args->connectTimeout, requestInitCancellation); + makeCancellationRequestWithTimeout(args->connectTimeout, _stop); bool success = _socket->connect(host, port, errMsg, isCancellationRequested); if (!success) @@ -243,7 +242,7 @@ namespace ix // Make a new cancellation object dealing with transfer timeout isCancellationRequested = - makeCancellationRequestWithTimeout(args->transferTimeout, requestInitCancellation); + makeCancellationRequestWithTimeout(args->transferTimeout, _stop); if (args->verbose) { diff --git a/ixwebsocket/IXWebSocketVersion.h b/ixwebsocket/IXWebSocketVersion.h index 32e61f6f..48656976 100644 --- a/ixwebsocket/IXWebSocketVersion.h +++ b/ixwebsocket/IXWebSocketVersion.h @@ -6,4 +6,4 @@ #pragma once -#define IX_WEBSOCKET_VERSION "9.5.2" +#define IX_WEBSOCKET_VERSION "9.5.3"