From 56baa87437a0079461ee68a85b514b93058f1460 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 19 Feb 2012 22:19:59 +1100 Subject: [PATCH] Make sure to request on the lp url when requesting a longpoll indrectly via get upstream work. --- cgminer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cgminer.c b/cgminer.c index 91f89342..b2442107 100644 --- a/cgminer.c +++ b/cgminer.c @@ -1577,6 +1577,7 @@ static bool get_upstream_work(struct work *work, bool lagging) json_t *val = NULL; int retries = 0; CURL *curl; + char *url; curl = curl_easy_init(); if (unlikely(!curl)) { @@ -1587,17 +1588,21 @@ static bool get_upstream_work(struct work *work, bool lagging) pool = select_pool(lagging); 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 * 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; + url = pool->lp_url; + } retry: /* A single failure response here might be reported as a dead pool and * there may be temporary denied messages etc. falsely reporting * failure so retry a few times before giving up */ 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); } if (unlikely(!val)) {