From 87d9ae399e0a35c89f9bf9af20874249f05967a8 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 23 Apr 2013 09:42:53 +0000
Subject: [PATCH] Turn single-threaded into a "proper" toggle directive
This turns "single-threaded" without argument into a syntax
error, but as it's only supposed to be used for debugging,
this shouldn't cause any problems.
The good news is that "single-threaded 0" no longer means
the same as "single-threaded 1" which was kinda non-intuitive.
---
doc/source/p-config.sgml | 10 +++++-----
loadcfg.c | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/doc/source/p-config.sgml b/doc/source/p-config.sgml
index 1990a5f0..10ccb3be 100644
--- a/doc/source/p-config.sgml
+++ b/doc/source/p-config.sgml
@@ -3,7 +3,7 @@
Purpose : Used with other docs and files only.
- $Id: p-config.sgml,v 2.99 2013/03/07 14:10:34 fabiankeil Exp $
+ $Id: p-config.sgml,v 2.100 2013/03/07 14:10:48 fabiankeil Exp $
Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/
See LICENSE.
@@ -97,7 +97,7 @@
Sample Configuration File for Privoxy &p-version;
</title>
<para>
- $Id: p-config.sgml,v 2.99 2013/03/07 14:10:34 fabiankeil Exp $
+ $Id: p-config.sgml,v 2.100 2013/03/07 14:10:48 fabiankeil Exp $
</para>
<para>
Copyright (C) 2001-2013 Privoxy Developers http://www.privoxy.org/
@@ -1084,13 +1084,13 @@ actionsfile
<varlistentry>
<term>Type of value:</term>
<listitem>
- <para><emphasis>None</emphasis></para>
+ <para><emphasis>1 or 0</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
<term>Default value:</term>
<listitem>
- <para><emphasis>Unset</emphasis></para>
+ <para><emphasis>0</emphasis></para>
</listitem>
</varlistentry>
<varlistentry>
@@ -1113,7 +1113,7 @@ actionsfile
</varlistentry>
</variablelist>
-<![%config-file;[<literallayout>@@#single-threaded</literallayout>]]>
+<![%config-file;[<literallayout>@@#single-threaded 1</literallayout>]]>
</sect3>
<!-- ~~~~~ New section ~~~~~ -->
diff --git a/loadcfg.c b/loadcfg.c
index 5a048cdd..fc31e2ca 100644
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.136 2013/03/01 17:39:05 fabiankeil Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.137 2013/03/07 14:08:49 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -1317,10 +1317,10 @@ struct configuration_spec * load_config(void)
break;
/* *************************************************************************
- * single-threaded
+ * single-threaded 0|1
* *************************************************************************/
case hash_single_threaded :
- config->multi_threaded = 0;
+ config->multi_threaded = 0 == parse_toggle_state(cmd, arg);
break;
/* *************************************************************************
--
2.50.1