From: wessels <> Date: Sat, 14 Sep 1996 00:51:21 +0000 (+0000) Subject: From: Neil Murray X-Git-Tag: SQUID_3_0_PRE1~5812 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fddcd1e0281e2b92d67ce596a5ce45b0100e7a79;p=thirdparty%2Fsquid.git From: Neil Murray I liked the idea of changeable defaults for cachemgr.cgi but thought something that I could bookmark so that getting to a number of different proxies was a bookmark away. Below is my attempt at achieving this. I use the QUERY_STRING environment variable to pass in the proxy host & port number as .../cgi-bin/cachemgr.cgi?: --- diff --git a/src/cachemgr.cc b/src/cachemgr.cc index 368255dea1..bfce415bb8 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.17 1996/08/30 23:23:27 wessels Exp $ + * $Id: cachemgr.cc,v 1.18 1996/09/13 18:51:21 wessels Exp $ * * DEBUG: Section 0 CGI Cache Manager * AUTHOR: Harvest Derived @@ -286,7 +286,7 @@ void print_trailer() printf("\n"); } -void noargs_html() +void noargs_html(char *host, int port) { printf("\r\n\r\n"); printf("Cache Manager Interface\n"); @@ -295,11 +295,12 @@ void noargs_html() printf("for the Squid object cache.

\n"); printf("
\n"); printf("
\n");
-    printf("
\n", script_name); + printf("\n", + script_name, host, port); printf("Cache Host:\n\n", CACHEMGR_HOSTNAME); + printf("SIZE=30 VALUE=\"%s\">\n\n", host); printf("Cache Port:\n\n", CACHE_HTTP_PORT); + printf("SIZE=30 VALUE=\"%d\">\n\n", port); printf("Password :\n\n"); printf("URL :Unknown CGI parameter: %s

\n", entries[x].name); - noargs_html(); + noargs_html(query_host, query_port); exit(0); } } if (!got_data) { /* prints HTML form if no args */ - noargs_html(); + noargs_html(query_host, query_port); exit(0); } if (hostname[0] == '\0') { printf("

ERROR

\n"); printf("

You must provide a hostname!\n


"); - noargs_html(); + noargs_html(query_host, query_port); exit(0); } close(0); @@ -687,7 +703,8 @@ int main(int argc, char *argv[]) printf("Cache Manager: %s:%s:%d\n", operation, hostname, portnum); - printf("\n", script_name); + printf("\n", + script_name, query_host, query_port); printf("\n"); printf("\n", portnum); printf("\n"); printf("
"); - printf("

Empty form

\n", script_name); + printf("

Empty form

\n", script_name, + query_host, query_port); printf("
\n"); printf("

%s: %s:%d

\n", operation,