X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=cgi.c;h=0d7a08553062bd6103cca44ee10f5c902f72b24b;hp=dd94e14b7281559a9ae559ad91c86dfa9cf73c05;hb=278b8bf5b0d1250132773bd10ffbca07c067b845;hpb=bdda4e2bd84f2162ba8f0d73eca293dafb3bb956 diff --git a/cgi.c b/cgi.c index dd94e14b..0d7a0855 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.97 2007/04/09 18:11:35 fabiankeil Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.99 2007/08/05 13:42:22 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -38,6 +38,12 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.97 2007/04/09 18:11:35 fabiankeil Exp $"; * * Revisions : * $Log: cgi.c,v $ + * Revision 1.99 2007/08/05 13:42:22 fabiankeil + * #1763173 from Stefan Huehner: declare some more functions static. + * + * Revision 1.98 2007/05/14 10:33:51 fabiankeil + * - Use strlcpy() and strlcat() instead of strcpy() and strcat(). + * * Revision 1.97 2007/04/09 18:11:35 fabiankeil * Don't mistake VC++'s _snprintf() for a snprintf() replacement. * @@ -898,7 +904,7 @@ struct http_response *dispatch_cgi(struct client_state *csp) * Returns : pointer to value (no copy!), or NULL if none found. * *********************************************************************/ -char *grep_cgi_referrer(const struct client_state *csp) +static char *grep_cgi_referrer(const struct client_state *csp) { struct list_entry *p; @@ -930,7 +936,7 @@ char *grep_cgi_referrer(const struct client_state *csp) * FALSE if the referrer is unsafe or not set. * *********************************************************************/ -int referrer_is_safe (const struct client_state *csp) +static int referrer_is_safe(const struct client_state *csp) { char *referrer; const char alternative_prefix[] = "http://" CGI_SITE_1_HOST "/"; @@ -1982,9 +1988,12 @@ struct http_response *finish_http_response(const struct client_state *csp, struc } /* - * Fill in the HTTP Status + * Fill in the HTTP Status, using HTTP/1.1 + * unless the client asked for HTTP/1.0. */ - snprintf(buf, sizeof(buf), "HTTP/1.0 %s", rsp->status ? rsp->status : "200 OK"); + snprintf(buf, sizeof(buf), "%s %s", + strcmpic(csp->http->ver, "HTTP/1.0") ? "HTTP/1.1" : "HTTP/1.0", + rsp->status ? rsp->status : "200 OK"); err = enlist_first(rsp->headers, buf); /* @@ -2020,12 +2029,12 @@ struct http_response *finish_http_response(const struct client_state *csp, struc if (strncmpic(rsp->status, "302", 3)) { - /* - * If it's not a redirect without any content, - * set the Content-Type to text/html if it's - * not already specified. - */ - if (!err) err = enlist_unique(rsp->headers, "Content-Type: text/html", 13); + /* + * If it's not a redirect without any content, + * set the Content-Type to text/html if it's + * not already specified. + */ + if (!err) err = enlist_unique(rsp->headers, "Content-Type: text/html", 13); } /*