From: Amos Jeffries Date: Tue, 12 Apr 2011 11:33:32 +0000 (+1200) Subject: Manager: send User-Agent header from cachemgr.cgi X-Git-Tag: take06~27^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4e635e13a0e8e7fc71cd9b47782861efab87e73;p=thirdparty%2Fsquid.git Manager: send User-Agent header from cachemgr.cgi Uses hard-coded string "cachemgr.cgi/" instead of progname to avoid complications from alternative names and when running under a browser. May be elided in transit however teh VERSION sent here will help the queried proxy respond appropriate to the CGI capabilities as we extend the types and content of reports coming back from the future releases. --- diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 4f52a157a6..392fe5d832 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -842,6 +842,7 @@ process_request(cachemgr_request * req) l = snprintf(buf, sizeof(buf), "GET cache_object://%s/%s%s%s HTTP/1.0\r\n" + "User-Agent: cachemgr.cgi/%s\r\n" "Accept: */*\r\n" "%s" /* Authentication info or nothing */ "\r\n", @@ -849,6 +850,7 @@ process_request(cachemgr_request * req) req->action, req->workers? "?workers=" : (req->processes ? "?processes=" : ""), req->workers? req->workers : (req->processes ? req->processes: ""), + VERSION, make_auth_header(req)); if (write(s, buf, l) < 0) { fprintf(stderr,"ERROR: (%d) writing request: '%s'\n", errno, buf);