summaryrefslogtreecommitdiff
path: root/src/feature/dirauth/dirauth_config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-02-20 08:48:17 -0500
committerNick Mathewson <nickm@torproject.org>2020-02-20 08:48:17 -0500
commitf733b8acd67f487a56e56bfb454ff99bc8d1cab0 (patch)
tree611a792d7e6ab2d9a181c453a71960298af4486a /src/feature/dirauth/dirauth_config.c
parenta79841fd83b6d800796c04855841170c364ff2a9 (diff)
parentf0964628e6e6b4f5dda6df30fbb19f74c59eccfd (diff)
downloadtor-f733b8acd67f487a56e56bfb454ff99bc8d1cab0.tar.gz
tor-f733b8acd67f487a56e56bfb454ff99bc8d1cab0.zip
Merge remote-tracking branch 'tor-github/pr/1719/head' into maint-0.4.3
Diffstat (limited to 'src/feature/dirauth/dirauth_config.c')
-rw-r--r--src/feature/dirauth/dirauth_config.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/feature/dirauth/dirauth_config.c b/src/feature/dirauth/dirauth_config.c
index 3aeeab3b31..ca16dc8424 100644
--- a/src/feature/dirauth/dirauth_config.c
+++ b/src/feature/dirauth/dirauth_config.c
@@ -27,6 +27,7 @@
#include "feature/dirauth/authmode.h"
#include "feature/dirauth/bwauth.h"
#include "feature/dirauth/dirauth_periodic.h"
+#include "feature/dirauth/dirauth_sys.h"
#include "feature/dirauth/dirvote.h"
#include "feature/dirauth/guardfraction.h"
#include "feature/dirauth/dirauth_options_st.h"
@@ -45,6 +46,14 @@
#define YES_IF_CHANGED_INT(opt) \
if (!CFG_EQ_INT(old_options, new_options, opt)) return 1;
+/** Return true iff we are configured to reject request under load for non
+ * relay connections. */
+bool
+dirauth_should_reject_requests_under_load(void)
+{
+ return !!dirauth_get_options()->AuthDirRejectRequestsUnderLoad;
+}
+
/**
* Legacy validation/normalization function for the dirauth mode options in
* options. Uses old_options as the previous options.