- char *s = NULL;
- int i;
- struct map *exports = default_exports(csp, "show-status");
-
-#ifdef SPLIT_PROXY_ARGS
- FILE * fp;
- char buf[BUFFER_SIZE];
- char * p;
- const char * filename = NULL;
- char * file_description = NULL;
-
-
- p = lookup(parameters, "file");
- switch (*p)
- {
- case 'p':
- if (csp->actions_list)
- {
- filename = csp->actions_list->filename;
- file_description = "Actions List";
- }
- break;
-
- case 'r':
- if (csp->rlist)
- {
- filename = csp->rlist->filename;
- file_description = "Regex Filter List";
- }
- break;
-
-#ifdef TRUST_FILES
- case 't':
- if (csp->tlist)
- {
- filename = csp->tlist->filename;
- file_description = "Trust List";
- }
- break;
-#endif /* def TRUST_FILES */
- }
-
- if (NULL != filename)
- {
- exports = map(exports, "file-description", 1, file_description, 1);
- exports = map(exports, "filepath", 1, html_encode(filename), 0);
-
- if ((fp = fopen(filename, "r")) == NULL)
- {
- exports = map(exports, "content", 1, "<h1>ERROR OPENING FILE!</h1>", 1);
- }
- else
- {
- while (fgets(buf, sizeof(buf), fp))
- {
- p = html_encode(buf);
- if (p)
- {
- s = strsav(s, p);
- freez(p);
- s = strsav(s, "<br>");
- }
- }
- fclose(fp);
- exports = map(exports, "contents", 1, s, 0);
- }
- rsp->body = fill_template(csp, "show-status-file", exports);
- free_map(exports);
- return(0);
-
- }
-
-#endif /* def SPLIT_PROXY_ARGS */
-
- exports = map(exports, "redirect-url", 1, REDIRECT_URL, 1);
-
- s = NULL;
- for (i=0; i < Argc; i++)
- {
- s = strsav(s, Argv[i]);
- s = strsav(s, " ");
- }
- exports = map(exports, "invocation", 1, s, 0);
-
- exports = map(exports, "options", 1, csp->config->proxy_args, 1);
- s = show_rcs();
- exports = map(exports, "sourceversions", 1, s, 0);
- s = show_defines();
- exports = map(exports, "defines", 1, s, 0);
-
-#ifdef STATISTICS
- exports = add_stats(exports);
-#else
- exports = map_block_killer(exports, "statistics");
-#endif /* ndef STATISTICS */
-
-#ifdef SPLIT_PROXY_ARGS
-
- exports = map_block_killer(exports, "no-split-args");
-
- if (csp->actions_list)
- {
- exports = map(exports, "actions-filename", 1, csp->actions_list->filename, 1);
- }
- else
- {
- exports = map(exports, "actions-filename", 1, "None specified", 1);
- }
-
- if (csp->rlist)
- {
- exports = map(exports, "re-filter-filename", 1, csp->rlist->filename, 1);
- }
- else
- {
- exports = map(exports, "re-filter-filename", 1, "None specified", 1);
- }
-
-#ifdef TRUST_FILES
- if (csp->tlist)
- {
- exports = map(exports, "trust-filename", 1, csp->tlist->filename, 1);
- }
- else
- {
- exports = map(exports, "trust-filename", 1, "None specified", 1);
- }
-#else
- exports = map_block_killer(exports, "trust-support");
-#endif /* ndef TRUST_FILES */
-
-#else /* ifndef SPLIT_PROXY_ARGS */
- exports = map_block_killer(exports, "split-args");
-
- if (csp->clist)
- {
- map(exports, "clist", 1, csp->clist->proxy_args , 1);
- }
-
- if (csp->rlist)
- {
- map(exports, "rlist", 1, csp->rlist->proxy_args , 1);
- }