[tor-commits] [tor/master] Bufferevent removal: remove more bufferevent-only options

nickm at torproject.org nickm at torproject.org
Fri Aug 12 20:11:39 UTC 2016


commit 88a7a027286046b1f9af3d495c1081a7f503efc5
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Aug 2 13:26:10 2016 -0400

    Bufferevent removal: remove more bufferevent-only options
    
    (All this IOCP stuff was bufferevent-only.)
---
 doc/tor.1.txt                | 20 --------------------
 src/common/compat_libevent.h |  2 --
 src/or/config.c              | 15 ++++-----------
 src/or/or.h                  | 11 -----------
 4 files changed, 4 insertions(+), 44 deletions(-)

diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index b5d6e87..b741a54 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -705,26 +705,6 @@ GENERAL OPTIONS
     networkstatus. This is an advanced option; you generally shouldn't have
     to mess with it. (Default: not set)
 
-[[DisableIOCP]] **DisableIOCP** **0**|**1**::
-    If Tor was built to use the Libevent's "bufferevents" networking code
-    and you're running on Windows, setting this option to 1 will tell Libevent
-    not to use the Windows IOCP networking API.  (Default: 1)
-
-[[UserspaceIOCPBuffers]] **UserspaceIOCPBuffers** **0**|**1**::
-    If IOCP is enabled (see DisableIOCP above), setting this option to 1
-    will tell Tor to disable kernel-space TCP buffers, in order to avoid
-    needless copy operations and try not to run out of non-paged RAM.
-    This feature is experimental; don't use it yet unless you're eager to
-    help tracking down bugs. (Default: 0)
-
-[[UseFilteringSSLBufferevents]] **UseFilteringSSLBufferevents** **0**|**1**::
-    Tells Tor to do its SSL communication using a chain of
-    bufferevents: one for SSL and one for networking.  This option has no
-    effect if bufferevents are disabled (in which case it can't turn on), or
-    if IOCP bufferevents are enabled (in which case it can't turn off).  This
-    option is useful for debugging only; most users shouldn't touch it.
-    (Default: 0)
-
 [[CountPrivateBandwidth]] **CountPrivateBandwidth** **0**|**1**::
     If this option is set, then Tor's rate-limiting applies not only to
     remote connections, but also to connections to private addresses like
diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h
index d9ccf1a..33da4fe 100644
--- a/src/common/compat_libevent.h
+++ b/src/common/compat_libevent.h
@@ -34,8 +34,6 @@ void periodic_timer_free(periodic_timer_t *);
 /** Defines a configuration for using libevent with Tor: passed as an argument
  * to tor_libevent_initialize() to describe how we want to set up. */
 typedef struct tor_libevent_cfg {
-  /** Flag: if true, disable IOCP (assuming that it could be enabled). */
-  int disable_iocp;
   /** How many CPUs should we use (relevant only with IOCP). */
   int num_cpus;
   /** How many milliseconds should we allow between updating bandwidth limits?
diff --git a/src/or/config.c b/src/or/config.c
index 5a59e2a..661a42e 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -113,7 +113,6 @@ static config_abbrev_t option_abbrevs_[] = {
   { "BridgeAuthoritativeDirectory", "BridgeAuthoritativeDir", 0, 0},
   { "HashedControlPassword", "__HashedControlSessionPassword", 1, 0},
   { "VirtualAddrNetwork", "VirtualAddrNetworkIPv4", 0, 0},
-  { "_UseFilteringSSLBufferevents", "UseFilteringSSLBufferevents", 0, 1},
   { NULL, NULL, 0, 0},
 };
 
@@ -225,7 +224,7 @@ static config_var_t option_vars_[] = {
   V(DirAuthorityFallbackRate,    DOUBLE,   "1.0"),
   V(DisableAllSwap,              BOOL,     "0"),
   V(DisableDebuggerAttachment,   BOOL,     "1"),
-  V(DisableIOCP,                 BOOL,     "1"),
+  OBSOLETE("DisableIOCP"),
   OBSOLETE("DisableV2DirectoryInfo_"),
   OBSOLETE("DynamicDHGroups"),
   VPORT(DNSPort,                     LINELIST, NULL),
@@ -440,7 +439,7 @@ static config_var_t option_vars_[] = {
   V(UseMicrodescriptors,         AUTOBOOL, "auto"),
   V(UseNTorHandshake,            AUTOBOOL, "1"),
   V(User,                        STRING,   NULL),
-  V(UserspaceIOCPBuffers,        BOOL,     "0"),
+  OBSOLETE("UserspaceIOCPBuffers"),
   V(AuthDirSharedRandomness,     BOOL,     "1"),
   OBSOLETE("V1AuthoritativeDirectory"),
   OBSOLETE("V2AuthoritativeDirectory"),
@@ -461,7 +460,8 @@ static config_var_t option_vars_[] = {
   V(VirtualAddrNetworkIPv4,      STRING,   "127.192.0.0/10"),
   V(VirtualAddrNetworkIPv6,      STRING,   "[FE80::]/10"),
   V(WarnPlaintextPorts,          CSV,      "23,109,110,143"),
-  V(UseFilteringSSLBufferevents, BOOL,    "0"),
+  OBSOLETE("UseFilteringSSLBufferevents"),
+  OBSOLETE("__UseFilteringSSLBufferevents"),
   VAR("__ReloadTorrcOnSIGHUP",   BOOL,  ReloadTorrcOnSIGHUP,      "1"),
   VAR("__AllDirActionsPrivate",  BOOL,  AllDirActionsPrivate,     "0"),
   VAR("__DisablePredictedCircuits",BOOL,DisablePredictedCircuits, "0"),
@@ -4218,12 +4218,6 @@ options_transition_allowed(const or_options_t *old,
     return -1;
   }
 
-  if (old->DisableIOCP != new_val->DisableIOCP) {
-    *msg = tor_strdup("While Tor is running, changing DisableIOCP "
-                      "is not allowed.");
-    return -1;
-  }
-
   if (old->DisableDebuggerAttachment &&
       !new_val->DisableDebuggerAttachment) {
     *msg = tor_strdup("While Tor is running, disabling "
@@ -7192,7 +7186,6 @@ init_libevent(const or_options_t *options)
   suppress_libevent_log_msg("Function not implemented");
 
   memset(&cfg, 0, sizeof(cfg));
-  cfg.disable_iocp = options->DisableIOCP;
   cfg.num_cpus = get_num_cpus(options);
   cfg.msec_per_tick = options->TokenBucketRefillInterval;
 
diff --git a/src/or/or.h b/src/or/or.h
index e091d5c..3ca9ea2 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -4292,12 +4292,6 @@ typedef struct {
    */
   double CircuitPriorityHalflife;
 
-  /** If true, do not enable IOCP on windows with bufferevents, even if
-   * we think we could. */
-  int DisableIOCP;
-  /** For testing only: will go away eventually. */
-  int UseFilteringSSLBufferevents;
-
   /** Set to true if the TestingTorNetwork configuration option is set.
    * This is used so that options_validate() has a chance to realize that
    * the defaults have changed. */
@@ -4321,11 +4315,6 @@ typedef struct {
    * never use it.  If -1, we do what the consensus says. */
   int OptimisticData;
 
-  /** If 1, and we are using IOCP, we set the kernel socket SNDBUF and RCVBUF
-   * to 0 to try to save kernel memory and avoid the dread "Out of buffers"
-   * issue. */
-  int UserspaceIOCPBuffers;
-
   /** If 1, we accept and launch no external network connections, except on
    * control ports. */
   int DisableNetwork;





More information about the tor-commits mailing list