[or-cvs] r9250: more cleanups, including a shiny new XXX012 (in tor/trunk: doc src/or)
arma at seul.org
arma at seul.org
Wed Jan 3 10:30:29 UTC 2007
Author: arma
Date: 2007-01-03 05:30:26 -0500 (Wed, 03 Jan 2007)
New Revision: 9250
Modified:
tor/trunk/doc/address-spec.txt
tor/trunk/doc/control-spec.txt
tor/trunk/src/or/config.c
tor/trunk/src/or/dirserv.c
tor/trunk/src/or/hibernate.c
tor/trunk/src/or/or.h
Log:
more cleanups, including a shiny new XXX012
Modified: tor/trunk/doc/address-spec.txt
===================================================================
--- tor/trunk/doc/address-spec.txt 2007-01-03 06:33:03 UTC (rev 9249)
+++ tor/trunk/doc/address-spec.txt 2007-01-03 10:30:26 UTC (rev 9250)
@@ -28,7 +28,10 @@
the exit node. If no "hostname" component is given, Tor defaults to the
published IPv4 address of the exit node.
- It is valid to try to resolve hostnames
+ It is valid to try to resolve hostnames, and in fact upon success Tor
+ will cache an internal mapaddress of the form
+ "www.google.com.foo.exit=64.233.161.99.foo.exit" to speed subsequent
+ lookups.
EXAMPLES:
www.example.com.exampletornode.exit
@@ -42,7 +45,7 @@
3. .onion
- SYNTAX [digest].onion
+ SYNTAX: [digest].onion
The digest is the first eighty bits of a SHA1 hash of the identity key for
a hidden service, encoded in base32.
@@ -52,7 +55,7 @@
4. .noconnect
- SYNTAX: [string].noconnect
+ SYNTAX: [string].noconnect
When Tor sees an address in this format, it immediately closes the
connection without attaching it to any circuit. This is useful for
Modified: tor/trunk/doc/control-spec.txt
===================================================================
--- tor/trunk/doc/control-spec.txt 2007-01-03 06:33:03 UTC (rev 9249)
+++ tor/trunk/doc/control-spec.txt 2007-01-03 10:30:26 UTC (rev 9250)
@@ -1143,7 +1143,7 @@
Syntax:
"650" SP "GUARDS" SP Type SP Name SP Status ... CRLF
Type = "ENTRY"
- Name = The (possibly verbose) nickname of the guard effected.
+ Name = The (possibly verbose) nickname of the guard affected.
Status = "NEW" | "UP" | "DOWN" | "BAD" | "GOOD" | "DROPPED"
[explain states. XXX]
Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c 2007-01-03 06:33:03 UTC (rev 9249)
+++ tor/trunk/src/or/config.c 2007-01-03 10:30:26 UTC (rev 9250)
@@ -208,7 +208,7 @@
VAR("OutboundBindAddress", STRING, OutboundBindAddress, NULL),
VAR("PathlenCoinWeight", DOUBLE, PathlenCoinWeight, "0.3"),
VAR("PidFile", STRING, PidFile, NULL),
- VAR("PreferTunneledDirConns", BOOL, PreferTunneledDirConns, "1"),
+ VAR("PreferTunneledDirConns", BOOL, PreferTunneledDirConns, "0"),
VAR("ProtocolWarnings", BOOL, ProtocolWarnings, "0"),
VAR("PublishServerDescriptor",BOOL, PublishServerDescriptor,"1"),
VAR("PublishHidServDescriptors",BOOL,PublishHidServDescriptors, "1"),
@@ -251,7 +251,7 @@
OBSOLETE("TrafficShaping"),
VAR("TransListenAddress", LINELIST, TransListenAddress, NULL),
VAR("TransPort", UINT, TransPort, "0"),
- VAR("TunnelDirConns", BOOL, TunnelDirConns, "1"),
+ VAR("TunnelDirConns", BOOL, TunnelDirConns, "0"),
VAR("UseEntryGuards", BOOL, UseEntryGuards, "1"),
VAR("User", STRING, User, NULL),
VAR("V1AuthoritativeDirectory",BOOL, V1AuthoritativeDir, "0"),
@@ -319,7 +319,7 @@
"control-spec.txt).", },
{ "CookieAuthentication", "If this option is set to 1, don't allow any "
"connections to the control port except when the connecting process "
- "can read a file that Tor creates in its data directory. " },
+ "can read a file that Tor creates in its data directory." },
{ "DataDirectory", "Store working data, state, keys, and caches here." },
{ "DirServer", "Tor only trusts directories signed with one of these "
"servers' keys. Used to override the standard list of directory "
@@ -344,7 +344,7 @@
{ "Log", "Where to send logging messages. Format is "
"minSeverity[-maxSeverity] (stderr|stdout|syslog|file FILENAME)." },
{ "OutboundBindAddress", "Make all outbound connections originate from the "
- "provided IP address (only usefol for multiple network interfaces)." },
+ "provided IP address (only useful for multiple network interfaces)." },
{ "PIDFile", "On startup, write our PID to this file. On clean shutdown, "
"remove the file." },
/* PreferTunneledDirConns */
@@ -365,25 +365,25 @@
"hostnames for having invalid characters." },
/* CircuitBuildTimeout, CircuitIdleTimeout */
{ "ClientOnly", "If set to 1, Tor will under no circumstances run as a "
- "server, even if ORPort is as configued." },
+ "server, even if ORPort is enabled." },
{ "EntryNodes", "A list of preferred entry nodes to use for the first hop "
- "in circuits, if possible." },
+ "in circuits, when possible." },
/* { "EnforceDistinctSubnets" , "" }, */
{ "ExitNodes", "A list of preferred nodes to use for the last hop in "
"circuits, when possible." },
{ "ExcludeNodes", "A list of nodes never to use when building a circuit." },
{ "FascistFirewall", "If set, Tor will only create outgoing connections to "
- "ORs running on the ports listed in FirewallPorts." },
- { "FirewallPorts", "A list of ports that we cann connect to. Only used "
+ "servers running on the ports listed in FirewallPorts." },
+ { "FirewallPorts", "A list of ports that we can connect to. Only used "
"when FascistFirewall is set." },
{ "LongLivedPorts", "A list of ports for services that tend to require "
- "long-lived connections." },
+ "high-uptime connections." },
{ "MapAddress", "Force Tor to treat all requests for one address as if "
"they were for another." },
{ "NewCircuitPeriod", "Force Tor to consider whether to build a new circuit "
- "every NUM sections." },
+ "every NUM seconds." },
{ "MaxCircuitDirtiness", "Do not attach new streams to a circuit that has "
- "been used up to this many seconds ago." },
+ "been used more than this many seconds ago." },
/* NatdPort, NatdListenAddress */
{ "NodeFamily", "A list of servers that constitute a 'family' and should "
"never be used in the same circuit." },
@@ -393,7 +393,7 @@
"By default, we assume all addresses are reachable." },
/* reachablediraddresses, reachableoraddresses. */
{ "RendNodes", "A list of preferred nodes to use for a rendezvous point, "
- "if possible." },
+ "when possible." },
{ "RendExcludenodes", "A list of nodes never to use as rendezvous points." },
/* SafeSOCKS */
{ "SOCKSPort", "The port where we listen for SOCKS connections from "
@@ -409,13 +409,13 @@
"configured EntryNodes can be used." },
/* TestSocks */
{ "TrackHostsExit", "Hosts and domains which should, if possible, be "
- "acccessed from the same exit node each time we connect to them." },
+ "accessed from the same exit node each time we connect to them." },
{ "TrackHostsExitExpire", "Time after which we forget which exit we were "
"using to connect to hosts in TrackHostsExit." },
/* "TransPort", "TransListenAddress */
{ "UseEntryGuards", "Set to 0 if we want to pick from the whole set of "
- "entry nodes for each server, rather than picking a set of 'Guards' to "
- "prevent profiling attacks." },
+ "servers for the first position in each circuit, rather than picking a "
+ "set of 'Guards' to prevent profiling attacks." },
/* === server options */
{ "Address", "The advertised (external) address we should use." },
@@ -442,8 +442,7 @@
{ "ORListenAddress", "Bind to this address to listen for connections from "
"clients and servers, instead of the default 0.0.0.0:ORPort." },
{ "PublishServerDescriptors", "Set to 0 in order to keep the server from "
- "uploading info to the directory authorities. This prevents clients "
- "from using your server." },
+ "uploading info to the directory authorities." },
/*{ "RedirectExit", "When an outgoing connection tries to connect to a "
*"given address, redirect it to another address instead." },
*/
@@ -452,10 +451,10 @@
"shutting down because of a SIGINT." },
/* { "TestVia", } */
- /* === directory cache optoins */
+ /* === directory cache options */
{ "DirPort", "Serve directory information from this port, and act as a "
"directory cache." },
- { "DirListenAddress", "Bind to this address to listen for connnections from "
+ { "DirListenAddress", "Bind to this address to listen for connections from "
"clients and servers, instead of the default 0.0.0.0:DirPort." },
{ "DirPolicy", "Set a policy to limit who can connect to the directory "
"port" },
@@ -2250,7 +2249,7 @@
{
int i, r;
config_line_t *cl;
- const char *uname;
+ const char *uname = get_uname();
char buf[1024];
#define REJECT(arg) \
do { *msg = tor_strdup(arg); return -1; } while (0)
@@ -2262,7 +2261,6 @@
if (options->ORPort < 0 || options->ORPort > 65535)
REJECT("ORPort option out of bounds.");
- uname = get_uname();
if (server_mode(options) &&
(!strcmpstart(uname, "Windows 95") ||
!strcmpstart(uname, "Windows 98") ||
@@ -2270,7 +2268,7 @@
log(LOG_WARN, LD_CONFIG, "Tor is running as a server, but you are "
"running %s; this probably won't work. See "
"http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#ServerOS "
- "for details.", get_uname());
+ "for details.", uname);
}
if (options->ORPort == 0 && options->ORListenAddress != NULL)
Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c 2007-01-03 06:33:03 UTC (rev 9249)
+++ tor/trunk/src/or/dirserv.c 2007-01-03 10:30:26 UTC (rev 9250)
@@ -1359,6 +1359,11 @@
*bw = router_get_advertised_bandwidth(ri);
total_bandwidth += *bw;
total_exit_bandwidth += *bw;
+ /* XXX012 The above line doesn't actually count exit bandwidth. */
+ /* While we're at it, we might want to avoid BadExit nodes when
+ * counting exit bandwidth. */
+ /* Also, we might want to document the one-third behavior in
+ * dir-spec.txt. */
smartlist_add(bandwidths, bw);
}
});
@@ -1495,7 +1500,7 @@
dirserv_compute_performance_thresholds(rl);
- exits_can_be_guards = total_exit_bandwidth > (total_bandwidth / 3);
+ exits_can_be_guards = total_exit_bandwidth >= (total_bandwidth / 3);
SMARTLIST_FOREACH(rl->routers, routerinfo_t *, ri, {
if (ri->cache_info.published_on >= cutoff) {
@@ -1516,7 +1521,7 @@
int f_named = naming && ri->is_named;
int f_valid = ri->is_valid;
int f_guard = f_fast && f_stable &&
- router_get_advertised_bandwidth(ri) > guard_bandwidth &&
+ router_get_advertised_bandwidth(ri) >= guard_bandwidth &&
(!f_exit || exits_can_be_guards);
int f_bad_exit = listbadexits && ri->is_bad_exit;
/* 0.1.1.9-alpha is the first version to support fetch by descriptor
Modified: tor/trunk/src/or/hibernate.c
===================================================================
--- tor/trunk/src/or/hibernate.c 2007-01-03 06:33:03 UTC (rev 9249)
+++ tor/trunk/src/or/hibernate.c 2007-01-03 10:30:26 UTC (rev 9250)
@@ -725,7 +725,7 @@
hibernate_soft_limit_reached(void)
{
uint64_t soft_limit = DBL_TO_U64(U64_TO_DBL(get_options()->AccountingMax)
- * .95);
+ * .95);
if (!soft_limit)
return 0;
return n_bytes_read_in_interval >= soft_limit
Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h 2007-01-03 06:33:03 UTC (rev 9249)
+++ tor/trunk/src/or/or.h 2007-01-03 10:30:26 UTC (rev 9250)
@@ -1014,7 +1014,7 @@
* an exit node. */
/** True iff we know version info for this router. (i.e., a "v" entry was
- * included.) We'll replace all these with a big tor_vesion_t or a char[]
+ * included.) We'll replace all these with a big tor_version_t or a char[]
* if the number of traits we care about ever becomes incredibly big. */
unsigned int version_known:1;
/** True iff this router is a version that supports BEGIN_DIR cells. */
@@ -2699,11 +2699,11 @@
typedef struct trusted_dir_server_t {
char *description;
char *nickname;
- char *address; /**< Hostname */
- uint32_t addr; /**< IPv4 address */
- uint16_t dir_port; /**< Directory port */
- uint16_t or_port; /**< OR port: Used for tunneling connections */
- char digest[DIGEST_LEN]; /**< Digest of identity key */
+ char *address; /**< Hostname. */
+ uint32_t addr; /**< IPv4 address. */
+ uint16_t dir_port; /**< Directory port. */
+ uint16_t or_port; /**< OR port: Used for tunneling connections. */
+ char digest[DIGEST_LEN]; /**< Digest of identity key. */
unsigned int is_running:1; /**< True iff we think this server is running. */
/** True iff this server is an authority for the older ("v1") directory
* protocol. */
More information about the tor-commits
mailing list