on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't.
--------------------------------------------------------------------
ChangeLog for Privoxy
--------------------------------------------------------------------
+*** Since 3.0.10
+
+- Support for remote toggling is controlled by the configure
+ option --disable-toggle only. In previous versions it also
+ depended on the action editor and thus configuring with the
+ --disable-editor option would disable remote toggling support
+ as well.
+
*** Version 3.0.10 ***
+
- Ordinary configuration file changes no longer cause program
termination on OS/2 if the name of the logfile hasn't been
changed as well. This regression probably crept in with the
-const char cgi_rcs[] = "$Id: cgi.c,v 1.109 2008/07/26 09:40:27 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.110 2008/08/31 14:55:43 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
*
* Revisions :
* $Log: cgi.c,v $
+ * Revision 1.110 2008/08/31 14:55:43 fabiankeil
+ * Add a @date@ symbol to include a date(1)-like time string
+ * in templates. Modified version of the patch Endre Szabo
+ * submitted in #2026468.
+ *
* Revision 1.109 2008/07/26 09:40:27 fabiankeil
* Remove the unconditional block in get_http_time().
* It's pointless now that it's no longer used to limit
#include "miscutil.h"
#include "cgisimple.h"
#include "jbsockets.h"
-#ifdef FEATURE_CGI_EDIT_ACTIONS
+#if defined(FEATURE_CGI_EDIT_ACTIONS) || defined(FEATURE_TOGGLE)
#include "cgiedit.h"
-#endif /* def FEATURE_CGI_EDIT_ACTIONS */
+#endif /* defined(FEATURE_CGI_EDIT_ACTIONS) || defined (FEATURE_TOGGLE) */
#include "loadcfg.h"
/* loadcfg.h is for global_toggle_state only */
#ifdef FEATURE_PTHREAD
cgi_show_url_info,
"Look up which actions apply to a URL and why",
TRUE },
-#ifdef FEATURE_CGI_EDIT_ACTIONS
#ifdef FEATURE_TOGGLE
{ "toggle",
cgi_toggle,
"Toggle Privoxy on or off",
FALSE },
#endif /* def FEATURE_TOGGLE */
+#ifdef FEATURE_CGI_EDIT_ACTIONS
{ "edit-actions", /* Edit the actions list */
cgi_edit_actions,
NULL, FALSE },
-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.60 2008/03/15 14:52:35 fabiankeil Exp $";
+const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.61 2008/03/24 18:12:52 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
*
* Revisions :
* $Log: cgiedit.c,v $
+ * Revision 1.61 2008/03/24 18:12:52 fabiankeil
+ * Use sizeof() more often.
+ *
* Revision 1.60 2008/03/15 14:52:35 fabiankeil
* Add CGI editor support for the "disable all filters of this type"
* directives "-client-header-filter", "-server-header-filter",
return cgi_redirect(rsp, target);
}
-#ifdef FEATURE_TOGGLE
-/*********************************************************************
- *
- * Function : cgi_toggle
- *
- * Description : CGI function that adds a new empty section to
- * an actions file.
- *
- * Parameters :
- * 1 : csp = Current client state (buffers, headers, etc...)
- * 2 : rsp = http_response data structure for output
- * 3 : parameters = map of cgi parameters
- *
- * CGI Parameters :
- * set : If present, how to change toggle setting:
- * "enable", "disable", "toggle", or none (default).
- * mini : If present, use mini reply template.
- *
- * Returns : JB_ERR_OK on success
- * JB_ERR_MEMORY on out-of-memory
- *
- *********************************************************************/
-jb_err cgi_toggle(struct client_state *csp,
- struct http_response *rsp,
- const struct map *parameters)
-{
- struct map *exports;
- char mode;
- const char *template_name;
-
- assert(csp);
- assert(rsp);
- assert(parameters);
-
- if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_TOGGLE))
- {
- return cgi_error_disabled(csp, rsp);
- }
-
- mode = get_char_param(parameters, "set");
-
- if (mode == 'E')
- {
- /* Enable */
- global_toggle_state = 1;
- }
- else if (mode == 'D')
- {
- /* Disable */
- global_toggle_state = 0;
- }
- else if (mode == 'T')
- {
- /* Toggle */
- global_toggle_state = !global_toggle_state;
- }
-
- if (NULL == (exports = default_exports(csp, "toggle")))
- {
- return JB_ERR_MEMORY;
- }
-
- template_name = (get_char_param(parameters, "mini")
- ? "toggle-mini"
- : "toggle");
-
- return template_fill_for_cgi(csp, template_name, exports, rsp);
-}
-#endif /* def FEATURE_TOGGLE */
/*********************************************************************
*
return err;
}
+#endif /* def FEATURE_CGI_EDIT_ACTIONS */
-#endif /* def FEATURE_CGI_EDIT_ACTIONS */
+#ifdef FEATURE_TOGGLE
+/*********************************************************************
+ *
+ * Function : cgi_toggle
+ *
+ * Description : CGI function that adds a new empty section to
+ * an actions file.
+ *
+ * Parameters :
+ * 1 : csp = Current client state (buffers, headers, etc...)
+ * 2 : rsp = http_response data structure for output
+ * 3 : parameters = map of cgi parameters
+ *
+ * CGI Parameters :
+ * set : If present, how to change toggle setting:
+ * "enable", "disable", "toggle", or none (default).
+ * mini : If present, use mini reply template.
+ *
+ * Returns : JB_ERR_OK on success
+ * JB_ERR_MEMORY on out-of-memory
+ *
+ *********************************************************************/
+jb_err cgi_toggle(struct client_state *csp,
+ struct http_response *rsp,
+ const struct map *parameters)
+{
+ struct map *exports;
+ char mode;
+ const char *template_name;
+
+ assert(csp);
+ assert(rsp);
+ assert(parameters);
+
+ if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_TOGGLE))
+ {
+ return cgi_error_disabled(csp, rsp);
+ }
+
+ mode = get_char_param(parameters, "set");
+
+ if (mode == 'E')
+ {
+ /* Enable */
+ global_toggle_state = 1;
+ }
+ else if (mode == 'D')
+ {
+ /* Disable */
+ global_toggle_state = 0;
+ }
+ else if (mode == 'T')
+ {
+ /* Toggle */
+ global_toggle_state = !global_toggle_state;
+ }
+
+ if (NULL == (exports = default_exports(csp, "toggle")))
+ {
+ return JB_ERR_MEMORY;
+ }
+
+ template_name = (get_char_param(parameters, "mini")
+ ? "toggle-mini"
+ : "toggle");
+
+ return template_fill_for_cgi(csp, template_name, exports, rsp);
+}
+#endif /* def FEATURE_TOGGLE */
/*
#ifndef CGIEDIT_H_INCLUDED
#define CGIEDIT_H_INCLUDED
-#define CGIEDIT_H_VERSION "$Id: cgiedit.h,v 1.7.2.2 2004/02/17 13:30:23 oes Exp $"
+#define CGIEDIT_H_VERSION "$Id: cgiedit.h,v 1.9 2006/07/18 14:48:45 david__schmidt Exp $"
/*********************************************************************
*
- * File : $Source: /cvsroot/ijbswa/current/Attic/cgiedit.h,v $
+ * File : $Source: /cvsroot/ijbswa/current/cgiedit.h,v $
*
* Purpose : CGI-based actionsfile editor.
*
*
* Revisions :
* $Log: cgiedit.h,v $
+ * Revision 1.9 2006/07/18 14:48:45 david__schmidt
+ * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
+ * with what was really the latest development (the v_3_0_branch branch)
+ *
* Revision 1.7.2.2 2004/02/17 13:30:23 oes
* Moved cgi_error_disabled() from cgiedit.c to
* cgi.c to re-enable build with --disable-editor.
extern jb_err cgi_edit_actions_section_swap (struct client_state *csp,
struct http_response *rsp,
const struct map *parameters);
-extern jb_err cgi_toggle (struct client_state *csp,
- struct http_response *rsp,
- const struct map *parameters);
#endif /* def FEATURE_CGI_EDIT_ACTIONS */
-
+#ifdef FEATURE_TOGGLE
+extern jb_err cgi_toggle(struct client_state *csp,
+ struct http_response *rsp,
+ const struct map *parameters);
+#endif /* def FEATURE_TOGGLE */
/* Revision control strings from this header and associated .c file */
extern const char cgiedit_rcs[];
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.78 2008/08/02 08:23:22 fabiankeil Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.79 2008/08/30 12:03:07 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.79 2008/08/30 12:03:07 fabiankeil
+ * Remove FEATURE_COOKIE_JAR.
+ *
* Revision 1.78 2008/08/02 08:23:22 fabiankeil
* If the enforce-blocks directive is used with FEATURE_FORCE_LOAD
* disabled, log a message that blocks will always be enforced
/* *************************************************************************
* enable-remote-toggle 0|1
* *************************************************************************/
-#ifdef FEATURE_CGI_EDIT_ACTIONS
+#ifdef FEATURE_TOGGLE
case hash_enable_remote_toggle:
if ((*arg != '\0') && (0 != atoi(arg)))
{
config->feature_flags &= ~RUNTIME_FEATURE_CGI_TOGGLE;
}
continue;
-#endif /* def FEATURE_CGI_EDIT_ACTIONS */
+#endif /* def FEATURE_TOGGLE */
/* *************************************************************************
* enable-remote-http-toggle 0|1
#endif /* ndef FEATURE_ACL */
#ifndef FEATURE_CGI_EDIT_ACTIONS
case hash_enable_edit_actions:
+#endif /* ndef FEATURE_CGI_EDIT_ACTIONS */
+#ifndef FEATURE_TOGGLE
case hash_enable_remote_toggle:
-#endif /* def FEATURE_CGI_EDIT_ACTIONS */
+#endif /* ndef FEATURE_TOGGLE */
#ifndef FEATURE_ACL
case hash_permit_access:
#endif /* ndef FEATURE_ACL */