Skip to content

Commit

Permalink
p2pool: fix crash without network connection
Browse files Browse the repository at this point in the history
  • Loading branch information
selsta committed Apr 9, 2023
1 parent 9b4f09a commit 0c9b5b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/p2pool/P2PoolManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(BINARY_NOT_AVAILABLE);
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<std::string, std::string> i : fields) {
if (i.first == "Location") {
Expand Down

0 comments on commit 0c9b5b6

Please sign in to comment.