Commit 17cc279adbe34e4474f4fec99e4c71d3226eda24

Con Kolivas 2012-02-18T22:41:48

Always use a fresh connection for longpoll as prolonged persistent connections can fail for many reasons.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cgminer.c b/cgminer.c
index 0c455f1..6447902 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3547,6 +3547,12 @@ new_longpoll:
 		json_t *val, *soval;
 
 		gettimeofday(&start, NULL);
+
+		/* Longpoll connections can be persistent for a very long time
+		 * and any number of issues could have come up in the meantime
+		 * so always establish a fresh connection instead of relying on
+		 * a persistent one. */
+		curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1);
 		val = json_rpc_call(curl, lp_url, pool->rpc_userpass, rpc_req,
 				    false, true, &rolltime, pool, false);
 		if (likely(val)) {