From b54c650d6a3c5a1c31a299175fda60d19b01b142 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 20 Mar 2015 11:13:30 +1100 Subject: [PATCH] Give parent proxy details where appropriate in getproxy --- src/stratifier.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 6f707e7e..0b9068d8 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -2338,7 +2338,7 @@ out: static void getproxy(sdata_t *sdata, const char *buf, int *sockd) { - proxy_t *proxy; + proxy_t *proxy, *parent; json_error_t err_val; json_t *val = NULL; int id, subid = 0; @@ -2361,15 +2361,16 @@ static void getproxy(sdata_t *sdata, const char *buf, int *sockd) val = json_errormsg("Failed to find proxy %d:%d", id, subid); goto out; } + parent = proxy->parent; JSON_CPACK(val, "{si,si,si,sf,ss,ss,ss,ss,si,si,si,si,sb,sb,sI,sI,sI,sI,si,sb}", - "id", proxy->id, "subid", proxy->subid, "priority", proxy->priority, + "id", proxy->id, "subid", proxy->subid, "priority", parent->priority, "diff", proxy->diff, "url", proxy->url, "auth", proxy->auth, "pass", proxy->pass, "enonce1", proxy->enonce1, "enonce1constlen", proxy->enonce1constlen, "enonce1varlen", proxy->enonce1varlen, "nonce2len", proxy->nonce2len, "enonce2varlen", proxy->enonce2varlen, "subscribed", proxy->subscribed, "notified", proxy->notified, "clients", proxy->clients, "max_clients", proxy->max_clients, - "bound_clients", proxy->bound_clients, "combined_clients", proxy->combined_clients, - "headroom", proxy->headroom, "subproxy_count", proxy->subproxy_count, + "bound_clients", proxy->bound_clients, "combined_clients", parent->combined_clients, + "headroom", proxy->headroom, "subproxy_count", parent->subproxy_count, "dead", proxy->dead); out: send_api_response(val, *sockd);