Browse Source

Merge commit '4f78cde' into bfgminer

Conflicts:
	util.c
Luke Dashjr 11 years ago
parent
commit
d8348f963e
2 changed files with 5 additions and 4 deletions
  1. 1 0
      miner.h
  2. 4 4
      util.c

+ 1 - 0
miner.h

@@ -1267,6 +1267,7 @@ struct pool {
 	char *stratum_url;
 	char *stratum_port;
 	CURL *stratum_curl;
+	char curl_err_str[CURL_ERROR_SIZE];
 	SOCKETTYPE sock;
 	char *sockbuf;
 	size_t sockbuf_size;

+ 4 - 4
util.c

@@ -2443,7 +2443,6 @@ curl_socket_t grab_socket_opensocket_cb(void *clientp, __maybe_unused curlsockty
 
 static bool setup_stratum_curl(struct pool *pool)
 {
-	char curl_err_str[CURL_ERROR_SIZE];
 	CURL *curl = NULL;
 	char s[RBUFSIZE];
 	bool ret = false;
@@ -2474,7 +2473,7 @@ static bool setup_stratum_curl(struct pool *pool)
 
 	curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1);
 	curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 30);
-	curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_err_str);
+	curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, pool->curl_err_str);
 	curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
 	if (!opt_delaynet)
 		curl_easy_setopt(curl, CURLOPT_TCP_NODELAY, 1);
@@ -2513,11 +2512,12 @@ retry:
 		if (try_tls)
 		{
 			applog(LOG_DEBUG, "Stratum connect failed with TLS to pool %u: %s",
-			       pool->pool_no, curl_err_str);
+			       pool->pool_no, pool->curl_err_str);
 			try_tls = false;
 			goto retry;
 		}
-		applog(LOG_INFO, "Stratum connect failed to pool %d: %s", pool->pool_no, curl_err_str);
+		applog(LOG_INFO, "Stratum connect failed to pool %d: %s",
+		       pool->pool_no, pool->curl_err_str);
 errout:
 		curl_easy_cleanup(curl);
 		pool->stratum_curl = NULL;