Turn single-threaded into a "proper" toggle directive
authorFabian Keil <fk@fabiankeil.de>
Tue, 23 Apr 2013 09:42:53 +0000 (09:42 +0000)
committerFabian Keil <fk@fabiankeil.de>
Tue, 23 Apr 2013 09:42:53 +0000 (09:42 +0000)
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
loadcfg.c

index 1990a5f..10ccb3b 100644 (file)
@@ -3,7 +3,7 @@
 
  Purpose     :  Used with other docs and files only.
 
 
  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.
 
  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>
  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/
 </para>
 <para>
 Copyright (C) 2001-2013 Privoxy Developers http://www.privoxy.org/
@@ -1084,13 +1084,13 @@ actionsfile
  <varlistentry>
   <term>Type of value:</term>
   <listitem>
  <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>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term>Default value:</term>
   <listitem>
-   <para><emphasis>Unset</emphasis></para>
+   <para><emphasis>0</emphasis></para>
   </listitem>
  </varlistentry>
  <varlistentry>
   </listitem>
  </varlistentry>
  <varlistentry>
@@ -1113,7 +1113,7 @@ actionsfile
  </varlistentry>
 </variablelist>
 
  </varlistentry>
 </variablelist>
 
-<![%config-file;[<literallayout>@@#single-threaded</literallayout>]]>
+<![%config-file;[<literallayout>@@#single-threaded 1</literallayout>]]>
 </sect3>
 
 <!--   ~~~~~       New section      ~~~~~     -->
 </sect3>
 
 <!--   ~~~~~       New section      ~~~~~     -->
index 5a048cd..fc31e2c 100644 (file)
--- 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 $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -1317,10 +1317,10 @@ struct configuration_spec * load_config(void)
             break;
 
 /* *************************************************************************
             break;
 
 /* *************************************************************************
- * single-threaded
+ * single-threaded 0|1
  * *************************************************************************/
          case hash_single_threaded :
  * *************************************************************************/
          case hash_single_threaded :
-            config->multi_threaded = 0;
+            config->multi_threaded =  0 == parse_toggle_state(cmd, arg);
             break;
 
 /* *************************************************************************
             break;
 
 /* *************************************************************************