]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
dirauth: Add option AuthDirRejectRequestsUnderLoad
authorDavid Goulet <dgoulet@torproject.org>
Tue, 11 Feb 2020 14:56:44 +0000 (09:56 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 11 Feb 2020 14:57:05 +0000 (09:57 -0500)
This controls the previous feature added that makes dirauth send back a 503
error code on non relay connections if under bandwidth pressure.

Signed-off-by: David Goulet <dgoulet@torproject.org>
doc/tor.1.txt
src/app/config/config.c
src/app/config/or_options_st.h

index 1504223b890188bb0baf0cae4d7b7071f7717046..c7c41e78419d4ae3a40d7876f4e463c5259f6837 100644 (file)
@@ -2925,6 +2925,13 @@ on the public Tor network.
     before it will treat advertised bandwidths as wholly
     unreliable. (Default: 500)
 
+[[AuthDirRejectRequestsUnderLoad]] **AuthDirRejectRequestsUnderLoad** **0**|**1**::
+    If set, the directory authority will start rejecting directory requests
+    from non relay connections by sending a 503 error code if it is under
+    bandwidth pressure (reaching the configured limit if any). Relays will
+    always tried to be answered even if this is on. (Default: 1)
+
+
 HIDDEN SERVICE OPTIONS
 ----------------------
 
index deda2448b639f4067079d3442eddd0377881fffc..89ec26f05ce82c73d03bec35fbec8e77698b2bf2 100644 (file)
@@ -671,6 +671,7 @@ static const config_var_t option_vars_[] = {
   OBSOLETE("UseNTorHandshake"),
   V(User,                        STRING,   NULL),
   OBSOLETE("UserspaceIOCPBuffers"),
+  V(AuthDirRejectRequestsUnderLoad, BOOL,  "1"),
   V(AuthDirSharedRandomness,     BOOL,     "1"),
   V(AuthDirTestEd25519LinkKeys,  BOOL,     "1"),
   OBSOLETE("V1AuthoritativeDirectory"),
index 32dcd9fb18352b2cd4b1b3ea6034ec93516c784d..e6be797017a935691c7a7de7fbb362857b6f4e00 100644 (file)
@@ -1008,6 +1008,13 @@ struct or_options_t {
    */
   uint64_t MaxUnparseableDescSizeToLog;
 
+  /** Bool (default: 1): Under bandwidth pressure, if set to 1, the authority
+   * will always answer directory requests from relays but will start sending
+   * 503 error code for the other connections. If set to 0, all connections
+   * are considered the same and the authority will try to answer them all
+   * regardless of bandwidth pressure or not. */
+  int AuthDirRejectRequestsUnderLoad;
+
   /** Bool (default: 1): Switch for the shared random protocol. Only
    * relevant to a directory authority. If off, the authority won't
    * participate in the protocol. If on (default), a flag is added to the