-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.103 2011/02/14 16:06:37 fabiankeil Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.107 2011/03/03 14:42:18 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
struct http_response *rsp,
const struct map *parameters)
{
+ static const char status[] = "200 OK Privoxy shutdown request received";
+ static const char body[] =
+ "<html>\n"
+ "<head>\n"
+ " <title>Privoxy shutdown request received</title>\n"
+ " <link rel=\"shortcut icon\" href=\"" CGI_PREFIX "error-favicon.ico\" type=\"image/x-icon\">\n"
+ " <link rel=\"stylesheet\" type=\"text/css\" href=\"http://config.privoxy.org/send-stylesheet\">\n"
+ "</head>\n"
+ "<body>\n"
+ "<h1>Privoxy shutdown request received</h1>\n"
+ "<p>Privoxy is going to shut down after the next request.</p>\n"
+ "</body>\n"
+ "</html>\n";
+
assert(csp);
assert(rsp);
assert(parameters);
/* 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;
+
+ rsp->content_length = 0;
+ rsp->head_length = 0;
+ rsp->is_static = 0;
+
+ rsp->body = strdup(body);
+ rsp->status = strdup(status);
- return JB_ERR_MEMORY;
+ if ((rsp->body == NULL) || (rsp->status == NULL))
+ {
+ return JB_ERR_MEMORY;
+ }
+
+ return JB_ERR_OK;
}
#endif /* def FEATURE_GRACEFUL_TERMINATION */
{
{".css", "text/css"},
{".jpg", "image/jpeg"},
+ {".jpeg", "image/jpeg"},
+ {".png", "image/png"},
};
for (i = 0; i < SZ(content_types); i++)