From fcc4309561321718858919bf03584a99b84ea070 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 5 Feb 2015 14:35:11 +1100 Subject: [PATCH] Add info about proxies to warnings --- src/generator.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/generator.c b/src/generator.c index d2708bdf..00ba3831 100644 --- a/src/generator.c +++ b/src/generator.c @@ -549,7 +549,8 @@ static bool parse_subscribe(connsock_t *cs, proxy_instance_t *proxi) retry: parsed = true; if (!(buf = new_proxy_line(cs))) { - LOGWARNING("Failed to receive line in parse_subscribe"); + LOGWARNING("Proxy %d:%s failed to receive line in parse_subscribe", + proxi->id, proxi->si->url); goto out; } LOGDEBUG("parse_subscribe received %s", buf); @@ -581,7 +582,8 @@ retry: buf = NULL; goto retry; } - LOGWARNING("Failed to parse subscribe response in parse_subscribe"); + LOGWARNING("Proxy %d:%s failed to parse subscribe response in parse_subscribe", + proxi->id, proxi->si->url); goto out; } @@ -623,7 +625,7 @@ retry: LOGWARNING("Invalid nonce2len %d in parse_subscribe", size); goto out; } - if (size == 3) + if (size == 3 || (size == 4 && proxi->ckp->clientsvspeed)) LOGWARNING("Nonce2 length %d means proxied clients can't be >5TH each", size); else if (size < 3) { LOGWARNING("Nonce2 length %d too small to be able to proxy", size); @@ -670,7 +672,8 @@ retry: ret = send_json_msg(cs, req); json_decref(req); if (!ret) { - LOGWARNING("Failed to send message in subscribe_stratum"); + LOGWARNING("Proxy %d:%s failed to send message in subscribe_stratum", + proxi->id, proxi->si->url); goto out; } ret = parse_subscribe(cs, proxi); @@ -678,20 +681,24 @@ retry: goto out; if (proxi->no_params) { - LOGWARNING("Failed all subscription options in subscribe_stratum"); + LOGWARNING("Proxy %d:%s failed all subscription options in subscribe_stratum", + proxi->id, proxi->si->url); goto out; } if (proxi->sessionid) { - LOGNOTICE("Failed sessionid reconnect in subscribe_stratum, retrying without"); + LOGNOTICE("Proxy %d:%s failed sessionid reconnect in subscribe_stratum, retrying without", + proxi->id, proxi->si->url); proxi->no_sessionid = true; dealloc(proxi->sessionid); } else { - LOGNOTICE("Failed connecting with parameters in subscribe_stratum, retrying without"); + LOGNOTICE("Proxy %d:%s failed connecting with parameters in subscribe_stratum, retrying without", + proxi->id, proxi->si->url); proxi->no_params = true; } ret = connect_proxy(cs); if (!ret) { - LOGWARNING("Failed to reconnect in subscribe_stratum"); + LOGWARNING("Proxy %d:%s failed to reconnect in subscribe_stratum", + proxi->id, proxi->si->url); goto out; } goto retry;