Browse Source

Bugfix: Stratum: Use curl_easy_cleanup to close connection, so cURL understands what is going on

Luke Dashjr 13 years ago
parent
commit
d3bf0b0da5
1 changed files with 3 additions and 2 deletions
  1. 3 2
      util.c

+ 3 - 2
util.c

@@ -1440,9 +1440,10 @@ void suspend_stratum(struct pool *pool)
 	applog(LOG_INFO, "Closing socket for stratum pool %d", pool->pool_no);
 	mutex_lock(&pool->stratum_lock);
 	pool->stratum_active = false;
-	mutex_unlock(&pool->stratum_lock);
-	CLOSESOCKET(pool->sock);
+	curl_easy_cleanup(pool->stratum_curl);
+	pool->stratum_curl = NULL;
 	pool->sock = INVSOCK;
+	mutex_unlock(&pool->stratum_lock);
 }
 
 void dev_error(struct cgpu_info *dev, enum dev_reason reason)