From 33310786dbb2e8817bfe4cac36b45069031d14bd Mon Sep 17 00:00:00 2001 From: selsta Date: Sun, 9 Apr 2023 18:26:03 +0200 Subject: [PATCH] p2pool: fix crash without network connection --- src/p2pool/P2PoolManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p2pool/P2PoolManager.cpp b/src/p2pool/P2PoolManager.cpp index 0119aa98..74391528 100644 --- a/src/p2pool/P2PoolManager.cpp +++ b/src/p2pool/P2PoolManager.cpp @@ -68,10 +68,10 @@ void P2PoolManager::download() { std::chrono::milliseconds timeout = std::chrono::seconds(10); http_client.set_server(url.host().toStdString(), "443", {}); bool success = http_client.invoke_get(url.path().toStdString(), timeout, {}, std::addressof(response), {{"User-Agent", userAgent}}); - if (response->m_response_code == 404) { + if (success && response->m_response_code == 404) { emit p2poolDownloadFailure(BinaryNotAvailable); return; - } else if (response->m_response_code == 302) { + } else if (success && response->m_response_code == 302) { epee::net_utils::http::fields_list fields = response->m_header_info.m_etc_fields; for (std::pair i : fields) { if (i.first == "Location") {