|
|
@ -2095,8 +2095,11 @@ static bool setup_stratum_socket(struct pool *pool) |
|
|
|
|
|
|
|
|
|
|
|
mutex_lock(&pool->stratum_lock); |
|
|
|
mutex_lock(&pool->stratum_lock); |
|
|
|
pool->stratum_active = false; |
|
|
|
pool->stratum_active = false; |
|
|
|
if (pool->sock) |
|
|
|
if (pool->sock) { |
|
|
|
|
|
|
|
/* FIXME: change to LOG_DEBUG if issue #88 resolved */ |
|
|
|
|
|
|
|
applog(LOG_INFO, "Closing %s socket", pool->poolname); |
|
|
|
CLOSESOCKET(pool->sock); |
|
|
|
CLOSESOCKET(pool->sock); |
|
|
|
|
|
|
|
} |
|
|
|
pool->sock = 0; |
|
|
|
pool->sock = 0; |
|
|
|
mutex_unlock(&pool->stratum_lock); |
|
|
|
mutex_unlock(&pool->stratum_lock); |
|
|
|
|
|
|
|
|
|
|
@ -2119,9 +2122,10 @@ static bool setup_stratum_socket(struct pool *pool) |
|
|
|
sockaddr_url = pool->sockaddr_url; |
|
|
|
sockaddr_url = pool->sockaddr_url; |
|
|
|
sockaddr_port = pool->stratum_port; |
|
|
|
sockaddr_port = pool->stratum_port; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (getaddrinfo(sockaddr_url, sockaddr_port, hints, &servinfo) != 0) { |
|
|
|
if (getaddrinfo(sockaddr_url, sockaddr_port, hints, &servinfo) != 0) { |
|
|
|
if (!pool->probed) { |
|
|
|
if (!pool->probed) { |
|
|
|
applog(LOG_WARNING, "Failed to resolve (?wrong URL) %s:%s", |
|
|
|
applog(LOG_WARNING, "Failed to resolve (wrong URL?) %s:%s", |
|
|
|
sockaddr_url, sockaddr_port); |
|
|
|
sockaddr_url, sockaddr_port); |
|
|
|
pool->probed = true; |
|
|
|
pool->probed = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -2278,6 +2282,8 @@ bool initiate_stratum(struct pool *pool) |
|
|
|
|
|
|
|
|
|
|
|
resend: |
|
|
|
resend: |
|
|
|
if (!setup_stratum_socket(pool)) { |
|
|
|
if (!setup_stratum_socket(pool)) { |
|
|
|
|
|
|
|
/* FIXME: change to LOG_DEBUG when issue #88 resolved */ |
|
|
|
|
|
|
|
applog(LOG_INFO, "setup_stratum_socket() on %s failed", pool->poolname); |
|
|
|
sockd = false; |
|
|
|
sockd = false; |
|
|
|
goto out; |
|
|
|
goto out; |
|
|
|
} |
|
|
|
} |
|
|
|