X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=cgi.c;h=b101b2cdd16628b5cc46bc796e0e24f56a89856f;hp=c6255526aec32db06986e050b6797aa3e4871f7c;hb=7367a58d13c72ef9978b46f416f9b4735981bdfb;hpb=0387d3626e82986c9f271890eac35a173b494b99 diff --git a/cgi.c b/cgi.c index c6255526..b101b2cd 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.5 2001/06/05 19:59:16 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -36,6 +36,69 @@ const char cgi_rcs[] = "$Id: $"; * * Revisions : * $Log: cgi.c,v $ + * Revision 1.5 2001/06/05 19:59:16 jongfoster + * Fixing multiline character string (a GCC-only "feature"), and snprintf (it's _snprintf under VC++). + * + * Revision 1.4 2001/06/04 10:41:52 swa + * show version string of cgi.h and cgi.c + * + * Revision 1.3 2001/06/03 19:12:16 oes + * introduced new cgi handling + * + * Revision 1.1 2001/06/03 11:03:48 oes + * Makefile/in + * + * introduced cgi.c + * + * actions.c: + * + * adapted to new enlist_unique arg format + * + * conf loadcfg.c + * + * introduced confdir option + * + * filters.c filtrers.h + * + * extracted-CGI relevant stuff + * + * jbsockets.c + * + * filled comment + * + * jcc.c + * + * support for new cgi mechansim + * + * list.c list.h + * + * functions for new list type: "map" + * extended enlist_unique + * + * miscutil.c .h + * introduced bindup() + * + * parsers.c parsers.h + * + * deleted const struct interceptors + * + * pcrs.c + * added FIXME + * + * project.h + * + * added struct map + * added struct http_response + * changes struct interceptors to struct cgi_dispatcher + * moved HTML stuff to cgi.h + * + * re_filterfile: + * + * changed + * + * showargs.c + * NO TIME LEFT + * * * **********************************************************************/ @@ -49,6 +112,10 @@ const char cgi_rcs[] = "$Id: $"; #include #include +#ifdef _WIN32 +#define snprintf _snprintf +#endif /* def _WIN32 */ + #include "project.h" #include "cgi.h" #include "list.h" @@ -62,6 +129,7 @@ const char cgi_rcs[] = "$Id: $"; #include "miscutil.h" #include "showargs.h" +const char cgi_h_rcs[] = CGI_H_VERSION; const struct cgi_dispatcher cgi_dispatchers[] = { { "show-status", @@ -120,7 +188,7 @@ struct http_response *cgi_dispatch(struct client_state *csp) argstring = csp->http->path; } /* Or it's the host part of HOME_PAGE_URL ? */ - else if ( (0 == strcmpic(csp->http->host, *&HOME_PAGE_URL + 7 )) + else if ( (0 == strcmpic(csp->http->host, HOME_PAGE_URL + 7 )) && (0 == strncmpic(csp->http->path,"/config", 7)) && ((csp->http->path[7] == '/') || (csp->http->path[7] == '\0'))) { @@ -312,7 +380,7 @@ char *fill_template(struct client_state *csp, char *template, struct map *answer pcrs_job *job, *joblist = NULL; char buf[BUFSIZ]; char *new, *old = NULL; - int error, size; + int size; FILE *fp; /* @@ -457,8 +525,8 @@ int cgi_default(struct client_state *csp, struct http_response *rsp, if(parameters) { p = dump_map(parameters); - tmp = strsav(tmp, "

What made you think this cgi takes options?\n - Anyway, here they are, in case you're interested:

\n"); + tmp = strsav(tmp, "

What made you think this cgi takes options?\n" + "Anyway, here they are, in case you're interested:

\n"); tmp = strsav(tmp, p); exports = map(exports, "cgi-parameters", 1, tmp, 0); free(p); @@ -584,9 +652,6 @@ int cgi_show_status(struct client_state *csp, struct http_response *rsp, struct map *parameters) { char *s = NULL; - const struct gateway *g; - int i; - struct map *exports = NULL; #ifdef SPLIT_PROXY_ARGS @@ -607,23 +672,6 @@ int cgi_show_status(struct client_state *csp, struct http_response *rsp, file_description = "Actions List"; } break; - case 'f': - if (csp->flist) - { - filename = csp->flist->filename; - file_description = "Forward List"; - } - break; - -#ifdef ACL_FILES - case 'a': - if (csp->alist) - { - filename = csp->alist->filename; - file_description = "Access Control List"; - } - break; -#endif /* def ACL_FILES */ #ifdef PCRS case 'r': @@ -682,8 +730,6 @@ int cgi_show_status(struct client_state *csp, struct http_response *rsp, exports = map(exports, "version", 1, VERSION, 1); exports = map(exports, "home-page", 1, HOME_PAGE_URL, 1); exports = map(exports, "invocation-args", 1, csp->config->proxy_args_header, 1); - exports = map(exports, "gateways", 1, csp->config->proxy_args_gateways, 1); - exports = map(exports, "gateway-protocols", 1, s, 0); #ifdef STATISTICS @@ -702,28 +748,6 @@ int cgi_show_status(struct client_state *csp, struct http_response *rsp, exports = map(exports, "actions-filename", 1, "None specified", 1); } - if (csp->flist) - { - exports = map(exports, "forward-filename", 1, csp->flist->filename, 1); - } - else - { - exports = map(exports, "forward-filename", 1, "None specified", 1); - } - -#ifdef ACL_FILES - if (csp->alist) - { - exports = map(exports, "acl-filename", 1, csp->alist->filename, 1); - } - else - { - exports = map(exports, "acl-filename", 1, "None specified", 1); - } -#else - exports = map(exports, "acl-killer-start.*acl-killer-end", 1, "", 1); -#endif /* ndef ACL_FILES */ - #ifdef PCRS if (csp->rlist) { @@ -760,18 +784,6 @@ int cgi_show_status(struct client_state *csp, struct http_response *rsp, map(exports, "clist", 1, csp->clist->proxy_args , 1); } - if (csp->flist) - { - map(exports, "flist", 1, csp->flist->proxy_args , 1); - } - -#ifdef ACL_FILES - if (csp->alist) - { - map(exports, "alist", 1, csp->alist->proxy_args , 1); - } -#endif /* def ACL_FILES */ - #ifdef PCRS if (csp->rlist) {