-const char cgi_rcs[] = "$Id: cgi.c,v 1.118 2009/05/28 17:07:42 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.119 2009/05/28 21:13:34 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
* 2 : templatename = Which template should be used for the answer
- * 3 : sys_err = system error number
*
* Returns : A http_response. If we run out of memory, this
* will be cgi_error_memory().
*
*********************************************************************/
struct http_response *error_response(struct client_state *csp,
- const char *templatename,
- int sys_err)
+ const char *templatename)
{
jb_err err;
struct http_response *rsp;
if (!err) err = map(exports, "host", 1, html_encode(csp->http->host), 0);
if (!err) err = map(exports, "hostport", 1, html_encode(csp->http->hostport), 0);
if (!err) err = map(exports, "path", 1, html_encode_and_free_original(path), 0);
- if (!err) err = map(exports, "error", 1, html_encode_and_free_original(safe_strerror(sys_err)), 0);
if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1);
if (!err)
{
#ifndef CGI_H_INCLUDED
#define CGI_H_INCLUDED
-#define CGI_H_VERSION "$Id: cgi.h,v 1.35 2008/05/21 15:24:37 fabiankeil Exp $"
+#define CGI_H_VERSION "$Id: cgi.h,v 1.36 2009/05/16 13:27:20 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.h,v $
* Functions declared include:
*
*
- * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge
+ * Copyright : Written by and Copyright (C) 2001-2009 the
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
extern struct http_response *dispatch_cgi(struct client_state *csp);
/* Not exactly a CGI */
-extern struct http_response * error_response(struct client_state *csp,
- const char *templatename,
- int err);
+extern struct http_response *error_response(struct client_state *csp,
+ const char *templatename);
/*
* CGI support functions
-const char jcc_rcs[] = "$Id: jcc.c,v 1.252 2009/06/08 16:48:50 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.253 2009/06/08 16:50:35 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
if (fwd->type != SOCKS_NONE)
{
/* Socks error. */
- rsp = error_response(csp, "forwarding-failed", errno);
+ rsp = error_response(csp, "forwarding-failed");
}
else if (errno == EINVAL)
{
- rsp = error_response(csp, "no-such-domain", errno);
+ rsp = error_response(csp, "no-such-domain");
}
else
{
- rsp = error_response(csp, "connect-failed", errno);
+ rsp = error_response(csp, "connect-failed");
log_error(LOG_LEVEL_CONNECT, "connect to: %s failed: %E",
http->hostport);
}
log_error(LOG_LEVEL_CONNECT,
"write header to: %s failed: %E", http->hostport);
- rsp = error_response(csp, "connect-failed", errno);
+ rsp = error_response(csp, "connect-failed");
if (rsp)
{
send_crunch_response(csp, rsp);