Browse Source

Make sure to request on the lp url when requesting a longpoll indrectly via get upstream work.

Con Kolivas 14 years ago
parent
commit
56baa87437
1 changed files with 7 additions and 2 deletions
  1. 7 2
      cgminer.c

+ 7 - 2
cgminer.c

@@ -1577,6 +1577,7 @@ static bool get_upstream_work(struct work *work, bool lagging)
 	json_t *val = NULL;
 	json_t *val = NULL;
 	int retries = 0;
 	int retries = 0;
 	CURL *curl;
 	CURL *curl;
+	char *url;
 
 
 	curl = curl_easy_init();
 	curl = curl_easy_init();
 	if (unlikely(!curl)) {
 	if (unlikely(!curl)) {
@@ -1587,17 +1588,21 @@ static bool get_upstream_work(struct work *work, bool lagging)
 	pool = select_pool(lagging);
 	pool = select_pool(lagging);
 	applog(LOG_DEBUG, "DBG: sending %s get RPC call: %s", pool->rpc_url, rpc_req);
 	applog(LOG_DEBUG, "DBG: sending %s get RPC call: %s", pool->rpc_url, rpc_req);
 
 
+	url = pool->rpc_url;
+
 	/* If this is the current pool and supports longpoll but has not sent
 	/* If this is the current pool and supports longpoll but has not sent
 	 * a longpoll, send one now */
 	 * a longpoll, send one now */
-	if (unlikely(pool == current_pool() && pool->hdr_path && !pool->lp_sent))
+	if (unlikely(pool == current_pool() && pool->hdr_path && !pool->lp_sent)) {
 		req_longpoll = true;
 		req_longpoll = true;
+		url = pool->lp_url;
+	}
 
 
 retry:
 retry:
 	/* A single failure response here might be reported as a dead pool and
 	/* A single failure response here might be reported as a dead pool and
 	 * there may be temporary denied messages etc. falsely reporting
 	 * there may be temporary denied messages etc. falsely reporting
 	 * failure so retry a few times before giving up */
 	 * failure so retry a few times before giving up */
 	while (!val && retries++ < 3) {
 	while (!val && retries++ < 3) {
-		val = json_rpc_call(curl, pool->rpc_url, pool->rpc_userpass, rpc_req,
+		val = json_rpc_call(curl, url, pool->rpc_userpass, rpc_req,
 			    false, req_longpoll, &work->rolltime, pool, false);
 			    false, req_longpoll, &work->rolltime, pool, false);
 	}
 	}
 	if (unlikely(!val)) {
 	if (unlikely(!val)) {