[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.2.1] Add public_server_mode function.



commit 07ab559a8e9932fbed1e00e3210a1bb855cf1508
Author: Robert Ransom <rransom.8774@xxxxxxxxx>
Date:   Fri Oct 1 00:07:10 2010 -0700

    Add public_server_mode function.
---
 src/or/or.h     |    1 +
 src/or/router.c |    9 +++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/or/or.h b/src/or/or.h
index 0f5b2bb..f405113 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -4239,6 +4239,7 @@ int authdir_mode_tests_reachability(or_options_t *options);
 int authdir_mode_bridge(or_options_t *options);
 
 int server_mode(or_options_t *options);
+int public_server_mode(or_options_t *options);
 int advertised_server_mode(void);
 int proxy_mode(or_options_t *options);
 void consider_publishable_server(int force);
diff --git a/src/or/router.c b/src/or/router.c
index 2afde74..45eeca0 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -954,6 +954,15 @@ server_mode(or_options_t *options)
   return (options->ORPort != 0 || options->ORListenAddress);
 }
 
+/** Return true iff we are trying to be a non-bridge server.
+ */
+int
+public_server_mode(or_options_t *options)
+{
+  if (!server_mode(options)) return 0;
+  return (!options->BridgeRelay);
+}
+
 /** Remember if we've advertised ourselves to the dirservers. */
 static int server_is_advertised=0;
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits