X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=cgisimple.c;h=527db0eb4e5f4bb4f0547f3515d93a33f05cc825;hp=53634c800c5756ebebfe26d31b23536473aabff1;hb=8eee84ac9966f874b14ad7bf34de3f9e9bff947b;hpb=3eb5001fbe89d3991cf4accce0103010d3a2897c diff --git a/cgisimple.c b/cgisimple.c index 53634c80..527db0eb 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.12 2002/01/23 01:03:32 jongfoster Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.13 2002/02/21 00:10:37 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -36,6 +36,9 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.12 2002/01/23 01:03:32 jongfo * * Revisions : * $Log: cgisimple.c,v $ + * Revision 1.13 2002/02/21 00:10:37 jongfoster + * Adding send-banner?type=auto option + * * Revision 1.12 2002/01/23 01:03:32 jongfoster * Fixing gcc [CygWin] compiler warnings * @@ -312,8 +315,8 @@ jb_err cgi_show_request(struct client_state *csp, * * CGI Parameters : * type : Selects the type of banner between "trans", "logo", - * and "auto". Defaults to "logo" if absent or invalid. - * "auto" means to select as if we were image-blocking. + * and "auto". Defaults to "logo" if absent or invalid. + * "auto" means to select as if we were image-blocking. * (Only the first character really counts). * * Returns : JB_ERR_OK on success @@ -323,28 +326,28 @@ jb_err cgi_show_request(struct client_state *csp, jb_err cgi_send_banner(struct client_state *csp, struct http_response *rsp, const struct map *parameters) -{ +{ char imagetype = lookup(parameters, "type")[0]; - - if (imagetype == 'a') /* auto */ - { - /* Default to logo */ - imagetype = 'l'; -#ifdef FEATURE_IMAGE_BLOCKING - if ((csp->action->flags & ACTION_IMAGE_BLOCKER) != 0) - { - /* determine HOW images should be blocked */ - const char * p = csp->action->string[ACTION_STRING_IMAGE_BLOCKER]; - - /* and handle accordingly: */ - if ((p != NULL) && (0 == strcmpic(p, "blank"))) - { - imagetype = 't'; - } - } -#endif /* def FEATURE_IMAGE_BLOCKING */ - } - + + if (imagetype == 'a') /* auto */ + { + /* Default to logo */ + imagetype = 'l'; +#ifdef FEATURE_IMAGE_BLOCKING + if ((csp->action->flags & ACTION_IMAGE_BLOCKER) != 0) + { + /* determine HOW images should be blocked */ + const char * p = csp->action->string[ACTION_STRING_IMAGE_BLOCKER]; + + /* and handle accordingly: */ + if ((p != NULL) && (0 == strcmpic(p, "blank"))) + { + imagetype = 't'; + } + } +#endif /* def FEATURE_IMAGE_BLOCKING */ + } + if ((imagetype != 't') && (imagetype != 'b')) /* transparant/blank */ { rsp->body = bindup(image_junkbuster_gif_data, image_junkbuster_gif_length);