mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-22 19:49:34 +00:00
p2pool: fix crash without network connection
This commit is contained in:
parent
6ac8e7a464
commit
33310786db
1 changed files with 2 additions and 2 deletions
|
@ -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<std::string, std::string> i : fields) {
|
||||
if (i.first == "Location") {
|
||||
|
|
Loading…
Reference in a new issue