aboutsummaryrefslogtreecommitdiff
path: root/src/tools/extractor_common
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-09-26 00:07:56 +0200
committerShauren <shauren.trinity@gmail.com>2023-09-26 00:07:56 +0200
commitb84199f1375b465789e024ba0795071a7e0aa78b (patch)
tree09bce8025b722cc0cc9a23533c284d87b8939f09 /src/tools/extractor_common
parent618ee510d6386763606067ab817a6593c3b17eb3 (diff)
Tools/Extractors: Log error message instead of crashing when downloading tact keys fails
Closes #29338
Diffstat (limited to 'src/tools/extractor_common')
-rw-r--r--src/tools/extractor_common/CascHandles.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tools/extractor_common/CascHandles.cpp b/src/tools/extractor_common/CascHandles.cpp
index 7a984fb0784..bb3692a1393 100644
--- a/src/tools/extractor_common/CascHandles.cpp
+++ b/src/tools/extractor_common/CascHandles.cpp
@@ -99,7 +99,12 @@ namespace
// Read the response status line.
boost::asio::streambuf response;
- boost::asio::read_until(socket, response, "\r\n");
+ boost::asio::read_until(socket, response, "\r\n", error);
+ if (error)
+ {
+ printf("Downloading tact key list failed to read HTTP response status %s", error.message().c_str());
+ return {};
+ }
// Check that response is OK.
std::string http_version;
@@ -119,6 +124,11 @@ namespace
// Read the response headers, which are terminated by a blank line.
boost::asio::read_until(socket, response, "\r\n\r\n");
+ if (error)
+ {
+ printf("Downloading tact key list failed to read HTTP response headers %s", error.message().c_str());
+ return {};
+ }
// Process the response headers.
std::string header;