X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=cgisimple.c;h=3ab3428efd9d9c8d18e864adeda1bb225a319dca;hp=81fab06f366485a4ae16eb60d23d46970a36a110;hb=2f946641e6706380d376f6946f30ebe239cc94bc;hpb=52d11ea17fffb62f755ee0060e4a6c72283894ad diff --git a/cgisimple.c b/cgisimple.c index 81fab06f..3ab3428e 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.105 2011/02/14 16:07:32 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.109 2011/04/19 13:00:47 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -181,6 +181,20 @@ jb_err cgi_die (struct client_state *csp, struct http_response *rsp, const struct map *parameters) { + static const char status[] = "200 OK Privoxy shutdown request received"; + static const char body[] = + "\n" + "\n" + " Privoxy shutdown request received\n" + " \n" + " \n" + "\n" + "\n" + "

Privoxy shutdown request received

\n" + "

Privoxy is going to shut down after the next request.

\n" + "\n" + "\n"; + assert(csp); assert(rsp); assert(parameters); @@ -188,12 +202,21 @@ jb_err cgi_die (struct client_state *csp, /* quit */ g_terminate = 1; - /* - * I don't really care what gets sent back to the browser. - * Take the easy option - "out of memory" page. - */ + csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; - return JB_ERR_MEMORY; + rsp->content_length = 0; + rsp->head_length = 0; + rsp->is_static = 0; + + rsp->body = strdup(body); + rsp->status = strdup(status); + + if ((rsp->body == NULL) || (rsp->status == NULL)) + { + return JB_ERR_MEMORY; + } + + return JB_ERR_OK; } #endif /* def FEATURE_GRACEFUL_TERMINATION */ @@ -755,7 +778,7 @@ jb_err cgi_send_user_manual(struct client_state *csp, { /* * We currently only support a flat file - * hierachy for the documentation. + * hierarchy for the documentation. */ log_error(LOG_LEVEL_ERROR, "Rejecting the request to serve '%s' as it contains '/' or '..'", @@ -1553,6 +1576,12 @@ static jb_err show_defines(struct map *exports) if (!err) err = map_conditional(exports, "FEATURE_CGI_EDIT_ACTIONS", 0); #endif /* ndef FEATURE_CGI_EDIT_ACTIONS */ +#ifdef FEATURE_COMPRESSION + if (!err) err = map_conditional(exports, "FEATURE_COMPRESSION", 1); +#else /* ifndef FEATURE_COMPRESSION */ + if (!err) err = map_conditional(exports, "FEATURE_COMPRESSION", 0); +#endif /* ndef FEATURE_COMPRESSION */ + #ifdef FEATURE_CONNECTION_KEEP_ALIVE if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_KEEP_ALIVE", 1); #else /* ifndef FEATURE_CONNECTION_KEEP_ALIVE */