change the templates directory.
-const char cgi_rcs[] = "$Id: cgi.c,v 1.89 2007/01/23 15:51:16 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.90 2007/01/25 13:47:26 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
*
* Revisions :
* $Log: cgi.c,v $
+ * Revision 1.90 2007/01/25 13:47:26 fabiankeil
+ * Added "forwarding-failed" template support for error_response().
+ *
* Revision 1.89 2007/01/23 15:51:16 fabiankeil
* Add favicon delivery functions.
*
* Function : template_load
*
* Description : CGI support function that loads a given HTML
- * template from the confdir, ignoring comment
- * lines and following #include statements up to
- * a depth of 1.
+ * template, ignoring comment lines and following
+ * #include statements up to a depth of 1.
*
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
}
}
- /* Generate full path */
+ /*
+ * Generate full path using either templdir
+ * or confdir/templates as base directory.
+ */
+ if (NULL != csp->config->templdir)
+ {
+ templates_dir_path = strdup(csp->config->templdir);
+ }
+ else
+ {
+ templates_dir_path = make_path(csp->config->confdir, "templates");
+ }
- templates_dir_path = make_path(csp->config->confdir, "templates");
if (templates_dir_path == NULL)
{
+ log_error(LOG_LEVEL_ERROR, "Out of memory while generating template path for %s.",
+ templatename);
return JB_ERR_MEMORY;
}
free(templates_dir_path);
if (full_path == NULL)
{
+ log_error(LOG_LEVEL_ERROR, "Out of memory while generating full template path for %s.",
+ templatename);
return JB_ERR_MEMORY;
}
file_buffer = strdup("");
if (file_buffer == NULL)
{
+ log_error(LOG_LEVEL_ERROR, "Not enough free memory to buffer %s.", full_path);
free(full_path);
return JB_ERR_MEMORY;
}
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.58 2006/12/31 14:24:29 fabiankeil Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.59 2006/12/31 17:56:38 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
* routine to load the configuration and the global
* variables it writes to.
*
- * Copyright : Written by and Copyright (C) 2001 the SourceForge
+ * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.59 2006/12/31 17:56:38 fabiankeil
+ * Added config option accept-intercepted-requests
+ * and disabled it by default.
+ *
* Revision 1.58 2006/12/31 14:24:29 fabiankeil
* Fix gcc43 compiler warnings.
*
#define hash_single_threaded 4250084780ul /* "single-threaded" */
#define hash_split_large_cgi_forms 671658948ul /* "split-large-cgi-forms" */
#define hash_suppress_blocklists 1948693308ul /* "suppress-blocklists" */
+#define hash_templdir 11067889ul /* "templdir" */
#define hash_toggle 447966ul /* "toggle" */
#define hash_trust_info_url 430331967ul /* "trust-info-url" */
#define hash_trustfile 56494766ul /* "trustfile" */
freez(config->confdir);
freez(config->logdir);
+ freez(config->templdir);
freez(config->haddr);
freez(config->logfile);
}
continue;
+/* *************************************************************************
+ * templdir directory-name
+ * *************************************************************************/
+ case hash_templdir :
+ freez(config->templdir);
+ config->templdir = make_path(NULL, arg);
+ continue;
+
/* *************************************************************************
* toggle (0|1)
* *************************************************************************/
#ifndef PROJECT_H_INCLUDED
#define PROJECT_H_INCLUDED
/** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.87 2007/01/01 19:36:37 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.88 2007/01/25 13:36:59 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/project.h,v $
*
* Revisions :
* $Log: project.h,v $
+ * Revision 1.88 2007/01/25 13:36:59 fabiankeil
+ * Add csp->error_message for failure reasons
+ * that should be embedded into the CGI pages.
+ *
* Revision 1.87 2007/01/01 19:36:37 fabiankeil
* Integrate a modified version of Wil Mahan's
* zlib patch (PR #895531).
/** The config file directory. */
const char *confdir;
+ /** The directory for customized CGI templates. */
+ const char *templdir;
+
/** The log file directory. */
const char *logdir;