summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-12-09 05:37:26 +0000
committerNick Mathewson <nickm@torproject.org>2005-12-09 05:37:26 +0000
commit39265dd72e9285ea61a0d2a16d7e80050ced546e (patch)
tree1affb9adb311c31f0c4e4613653940713655c21c
parent95e471c9a65f36776cb1fb9ccbcef4890640d7f4 (diff)
downloadtor-39265dd72e9285ea61a0d2a16d7e80050ced546e.tar.gz
tor-39265dd72e9285ea61a0d2a16d7e80050ced546e.zip
In my private little universe, terminals are still 80 columns. Impose a 160-character-per-line limit; this will creep down.
svn:r5548
-rwxr-xr-xcontrib/checkSpace.pl6
-rw-r--r--src/or/buffers.c24
-rw-r--r--src/or/config.c31
-rw-r--r--src/or/control.c9
-rw-r--r--src/or/directory.c15
-rw-r--r--src/or/dirserv.c4
-rw-r--r--src/or/hibernate.c6
-rw-r--r--src/or/main.c12
-rw-r--r--src/or/routerlist.c8
9 files changed, 91 insertions, 24 deletions
diff --git a/contrib/checkSpace.pl b/contrib/checkSpace.pl
index e0b9d6b93b..4b480e0f44 100755
--- a/contrib/checkSpace.pl
+++ b/contrib/checkSpace.pl
@@ -35,6 +35,12 @@ for $fn (@ARGV) {
} else {
$lastnil = 0;
}
+ ## Terminals are still 80 columns wide in my world. I refuse to
+ ## accept double-line lines.
+ if (/^.{160}/) {
+ print " Wide:$fn:$.\n";
+ }
+
### Juju to skip over comments and strings, since the tests
### we're about to do are okay there.
if ($C) {
diff --git a/src/or/buffers.c b/src/or/buffers.c
index ec447b291e..977a7d9a47 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -967,7 +967,12 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req, int log_sockstype)
buf_remove_from_front(buf, 10);
if (!address_is_in_virtual_range(req->address) &&
!have_warned_about_unsafe_socks) {
- warn(LD_APP,"Your application (using socks5 on port %d) is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead. For more information, please see http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#SOCKSAndDNS", req->port);
+ warn(LD_APP,"Your application (using socks5 on port %d) is giving "
+ "Tor only an IP address. Applications that do DNS resolves "
+ "themselves may leak information. Consider using Socks4A "
+ "(e.g. via privoxy or socat) instead. For more information, "
+ "please see http://wiki.noreply.org/noreply/TheOnionRouter/"
+ "TorFAQ#SOCKSAndDNS", req->port);
// have_warned_about_unsafe_socks = 1; // (for now, warn every time)
}
return 1;
@@ -986,7 +991,9 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req, int log_sockstype)
req->port = ntohs(get_uint16(buf->cur+5+len));
buf_remove_from_front(buf, 5+len+2);
if (log_sockstype)
- notice(LD_APP, "Your application (using socks5 on port %d) gave Tor a hostname, which means Tor will do the DNS resolve for you. This is good.", req->port);
+ notice(LD_APP, "Your application (using socks5 on port %d) gave "
+ "Tor a hostname, which means Tor will do the DNS resolve "
+ "for you. This is good.", req->port);
return 1;
default: /* unsupported */
warn(LD_APP,"socks5: unsupported address type %d. Rejecting.",*(buf->cur+3));
@@ -1041,7 +1048,10 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req, int log_sockstype)
if (socks4_prot != socks4a &&
!address_is_in_virtual_range(tmpbuf) &&
!have_warned_about_unsafe_socks) {
- warn(LD_APP,"Your application (using socks4 on port %d) is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead.", req->port);
+ warn(LD_APP,"Your application (using socks4 on port %d) is giving Tor "
+ "only an IP address. Applications that do DNS resolves "
+ "themselves may leak information. Consider using Socks4A (e.g. "
+ "via privoxy or socat) instead.", req->port);
// have_warned_about_unsafe_socks = 1; // (for now, warn every time)
}
if (socks4_prot == socks4a) {
@@ -1061,7 +1071,9 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req, int log_sockstype)
}
tor_assert(next < buf->cur+buf->datalen);
if (log_sockstype)
- notice(LD_APP, "Your application (using socks4a on port %d) gave Tor a hostname, which means Tor will do the DNS resolve for you. This is good.", req->port);
+ notice(LD_APP, "Your application (using socks4a on port %d) gave "
+ "Tor a hostname, which means Tor will do the DNS resolve "
+ "for you. This is good.", req->port);
}
debug(LD_APP,"socks4: Everything is here. Success.");
strlcpy(req->address, startaddr ? startaddr : tmpbuf,
@@ -1089,7 +1101,9 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req, int log_sockstype)
"</p>\n"
"<p>\n"
"See <a href=\"http://tor.eff.org/documentation.html\">http://tor.eff.org/documentation.html</a> for more information.\n"
-"<!-- Plus this comment, to make the body response more than 512 bytes, so IE will be willing to display it. Comment comment comment comment comment comment comment comment comment comment comment comment.-->\n"
+"<!-- Plus this comment, to make the body response more than 512 bytes, so "
+" IE will be willing to display it. Comment comment comment comment "
+" comment comment comment comment comment comment comment comment.-->\n"
"</p>\n"
"</body>\n"
"</html>\n"
diff --git a/src/or/config.c b/src/or/config.c
index 22a391e93a..0f2c0afdc8 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1799,7 +1799,9 @@ options_validate(or_options_t *old_options, or_options_t *options)
}
if (server_mode(options) && !options->ContactInfo)
- log(LOG_NOTICE, LD_CONFIG, "Your ContactInfo config option is not set. Please consider setting it, so we can contact you if your server is misconfigured or something else goes wrong.");
+ log(LOG_NOTICE, LD_CONFIG, "Your ContactInfo config option is not set. "
+ "Please consider setting it, so we can contact you if your server is "
+ "misconfigured or something else goes wrong.");
if (normalize_log_options(options))
return -1;
@@ -2016,7 +2018,9 @@ options_validate(or_options_t *old_options, or_options_t *options)
}
if (server_mode(options) &&
options->BandwidthRate < ROUTER_REQUIRED_MIN_BANDWIDTH*2) {
- log(LOG_WARN,LD_CONFIG,"BandwidthRate is set to %d bytes/second. For servers, it must be at least %d.", (int)options->BandwidthRate, ROUTER_REQUIRED_MIN_BANDWIDTH*2);
+ log(LOG_WARN,LD_CONFIG,"BandwidthRate is set to %d bytes/second. "
+ "For servers, it must be at least %d.",
+ (int)options->BandwidthRate, ROUTER_REQUIRED_MIN_BANDWIDTH*2);
result = -1;
}
if (options->BandwidthRate > options->BandwidthBurst)
@@ -2114,7 +2118,12 @@ options_validate(or_options_t *old_options, or_options_t *options)
if (options->DirServers) {
if (!old_options ||
!config_lines_eq(options->DirServers, old_options->DirServers))
- COMPLAIN("You have used DirServer to specify directory authorities in your configuration. This is potentially dangerous: it can make you look different from all other Tor users, and hurt your anonymity. Even if you've specified the same authorities as Tor uses by default, the defaults could change in the future. Be sure you know what you're doing.");
+ COMPLAIN("You have used DirServer to specify directory authorities in "
+ "your configuration. This is potentially dangerous: it can "
+ "make you look different from all other Tor users, and hurt "
+ "your anonymity. Even if you've specified the same "
+ "authorities as Tor uses by default, the defaults could "
+ "change in the future. Be sure you know what you're doing.");
for (cl = options->DirServers; cl; cl = cl->next) {
if (parse_dir_server_line(cl->value, 1)<0)
result = -1;
@@ -2682,7 +2691,9 @@ add_single_log_option(or_options_t *options, int minSeverity, int maxSeverity,
return -1;
}
- log(LOG_WARN, LD_CONFIG, "The old LogLevel/LogFile/DebugLogFile/SysLog options are deprecated, and will go away soon. Your new torrc line should be: 'Log %s'", buf);
+ log(LOG_WARN, LD_CONFIG, "The old LogLevel/LogFile/DebugLogFile/SysLog "
+ "options are deprecated, and will go away soon. Your new torrc line "
+ "should be: 'Log %s'", buf);
config_line_append(&options->Logs, "Log", buf);
tor_free(buf);
return 0;
@@ -2735,7 +2746,8 @@ normalize_log_options(or_options_t *options)
}
if (options->DebugLogFile) {
- if (add_single_log_option(options, LOG_DEBUG, LOG_ERR, "file", options->DebugLogFile) < 0)
+ if (add_single_log_option(options, LOG_DEBUG, LOG_ERR, "file",
+ options->DebugLogFile) < 0)
return -1;
}
@@ -2746,7 +2758,10 @@ normalize_log_options(or_options_t *options)
return 0;
}
-#define DEFAULT_EXIT_POLICY "reject private:*,reject *:25,reject *:119,reject *:135-139,reject *:445,reject *:465,reject *:587,reject *:1214,reject *:4661-4666,reject *:6346-6429,reject *:6699,reject *:6881-6999,accept *:*"
+#define DEFAULT_EXIT_POLICY \
+ "reject private:*,reject *:25,reject *:119,reject *:135-139,reject *:445," \
+ "reject *:465,reject *:587,reject *:1214,reject *:4661-4666," \
+ "reject *:6346-6429,reject *:6699,reject *:6881-6999,accept *:*"
/** Add the default exit policy entries to <b>policy</b>
*/
@@ -3081,7 +3096,9 @@ normalize_data_directory(or_options_t *options)
if (!options->DataDirectory && !strcmp(fn,"/.tor")) {
/* If our homedir is /, we probably don't want to use it. */
/* XXXX Default to /var/lib/tor? */
- warn(LD_CONFIG, "Default DataDirectory is \"~/.tor\". This expands to \"%s\", which is probably not what you want. Using \"%s/tor\" instead", fn, LOCALSTATEDIR);
+ warn(LD_CONFIG, "Default DataDirectory is \"~/.tor\". This expands to "
+ "\"%s\", which is probably not what you want. Using \"%s/tor\" "
+ "instead", fn, LOCALSTATEDIR);
tor_free(fn);
fn = tor_strdup(LOCALSTATEDIR"/tor");
diff --git a/src/or/control.c b/src/or/control.c
index 94a4ca14b5..d11aa02b62 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -985,7 +985,10 @@ handle_control_authenticate(connection_t *conn, uint32_t len, const char *body)
++i;
password = tor_malloc(i/2 + 1);
if (base16_decode(password, i/2+1, body, i)<0) {
- connection_write_str_to_buf("551 Invalid hexadecimal encoding. Maybe you tried a plain text password? If so, the standard requires you put it in double quotes.\r\n", conn);
+ connection_write_str_to_buf(
+ "551 Invalid hexadecimal encoding. Maybe you tried a plain text "
+ "password? If so, the standard requires you put it in double "
+ "quotes.\r\n", conn);
tor_free(password);
return 0;
}
@@ -1031,7 +1034,9 @@ handle_control_authenticate(connection_t *conn, uint32_t len, const char *body)
if (used_quoted_string)
connection_write_str_to_buf("515 Authentication failed\r\n", conn);
else
- connection_write_str_to_buf("515 Authentication failed. Maybe you tried a plain text password? If so, the standard requires you put it in double quotes.\r\n", conn);
+ connection_write_str_to_buf(
+ "515 Authentication failed. Maybe you tried a plain text password? "
+ "If so, the standard requires you put it in double quotes.\r\n",conn);
}
return 0;
ok:
diff --git a/src/or/directory.c b/src/or/directory.c
index f2c1ba30f4..b3f8bbe2e3 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1060,7 +1060,11 @@ connection_dir_client_reached_eof(connection_t *conn)
warn(LD_GENERAL,"http status 400 (\"%s\") response from dirserver '%s:%d'. Please correct.", reason, conn->address, conn->port);
break;
case 403:
- warn(LD_GENERAL,"http status 403 (\"%s\") response from dirserver '%s:%d'. Is your clock skewed? Have you mailed us your key fingerprint? Are you using the right key? Are you using a private IP address? See http://tor.eff.org/doc/tor-doc-server.html", reason, conn->address, conn->port);
+ warn(LD_GENERAL,"http status 403 (\"%s\") response from dirserver "
+ "'%s:%d'. Is your clock skewed? Have you mailed us your key "
+ "fingerprint? Are you using the right key? Are you using a "
+ "private IP address? See http://tor.eff.org/doc/"
+ "tor-doc-server.html", reason, conn->address, conn->port);
break;
default:
warn(LD_GENERAL,"http status %d (\"%s\") reason unexpected (server '%s:%d').", status_code, reason, conn->address, conn->port);
@@ -1365,14 +1369,19 @@ directory_handle_command_get(connection_t *conn, char *headers,
return -1;
}
tor_free(inp);
- tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: application/octet-stream\r\nContent-Encoding: deflate\r\n\r\n",
+ tor_snprintf(tmp, sizeof(tmp),
+ "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
+ "Content-Type: application/octet-stream\r\n"
+ "Content-Encoding: deflate\r\n\r\n",
date,
(int)compressed_len);
connection_write_to_buf(tmp, strlen(tmp), conn);
connection_write_to_buf(compressed, compressed_len, conn);
tor_free(compressed);
} else {
- tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\n\r\n",
+ tor_snprintf(tmp, sizeof(tmp),
+ "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
+ "Content-Type: text/plain\r\n\r\n",
date,
(int)len);
connection_write_to_buf(tmp, strlen(tmp), conn);
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 3dbe204286..7b52b6e62e 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -427,7 +427,9 @@ authdir_wants_to_reject_router(routerinfo_t *ri,
/* Is there too much clock skew? */
now = time(NULL);
if (ri->cache_info.published_on > now+ROUTER_ALLOW_SKEW) {
- notice(LD_DIRSERV, "Publication time for nickname '%s' is too far (%d minutes) in the future; possible clock skew. Not adding (ContactInfo '%s', platform '%s').",
+ notice(LD_DIRSERV, "Publication time for nickname '%s' is too far "
+ "(%d minutes) in the future; possible clock skew. Not adding "
+ "(ContactInfo '%s', platform '%s').",
ri->nickname, (int)((ri->cache_info.published_on-now)/60),
ri->contact_info ? ri->contact_info : "",
ri->platform ? ri->platform : "");
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 4024a11345..e0d8a0fff7 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -614,7 +614,11 @@ read_bandwidth_usage(void)
interval_start_time = t1;
expected_bandwidth_usage = expected_bw;
- info(LD_ACCT, "Successfully read bandwidth accounting file written at %s for interval starting at %s. We have been active for %lu seconds in this interval. At the start of the interval, we expected to use about %lu KB per second. ("U64_FORMAT" bytes read so far, "U64_FORMAT" bytes written so far)",
+ info(LD_ACCT, "Successfully read bandwidth accounting file written at %s "
+ "for interval starting at %s. We have been active for %lu seconds in "
+ "this interval. At the start of the interval, we expected to use "
+ "about %lu KB per second. ("U64_FORMAT" bytes read so far, "
+ U64_FORMAT" bytes written so far)",
(char*)smartlist_get(elts,2),
(char*)smartlist_get(elts,1),
(unsigned long)n_seconds_active_in_interval,
diff --git a/src/or/main.c b/src/or/main.c
index af9534da0b..cc617b5cc1 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -475,7 +475,9 @@ conn_close_if_marked(int i)
severity = LOG_INFO;
else
severity = LOG_NOTICE;
- log_fn(severity, LD_NET, "Something wrong with your network connection? Conn (addr %s, fd %d, type %s, state %d) tried to write %d bytes but timed out. (Marked at %s:%d)",
+ log_fn(severity, LD_NET, "Something wrong with your network connection? "
+ "Conn (addr %s, fd %d, type %s, state %d) tried to write %d "
+ "bytes but timed out. (Marked at %s:%d)",
safe_str(conn->address), conn->s, conn_type_to_string(conn->type),
conn->state,
(int)buf_datalen(conn->outbuf), conn->marked_for_close_file,
@@ -921,10 +923,14 @@ second_elapsed_callback(int fd, short event, void *args)
/* every 20 minutes, check and complain if necessary */
routerinfo_t *me = router_get_my_routerinfo();
if (me && !check_whether_orport_reachable())
- warn(LD_CONFIG,"Your server (%s:%d) has not managed to confirm that its ORPort is reachable. Please check your firewalls, ports, address, /etc/hosts file, etc.",
+ warn(LD_CONFIG,"Your server (%s:%d) has not managed to confirm that "
+ "its ORPort is reachable. Please check your firewalls, ports, "
+ "address, /etc/hosts file, etc.",
me->address, me->or_port);
if (me && !check_whether_dirport_reachable())
- warn(LD_CONFIG,"Your server (%s:%d) has not managed to confirm that its DirPort is reachable. Please check your firewalls, ports, address, /etc/hosts file, etc.",
+ warn(LD_CONFIG,"Your server (%s:%d) has not managed to confirm that its "
+ "DirPort is reachable. Please check your firewalls, ports, "
+ "address, /etc/hosts file, etc.",
me->address, me->dir_port);
}
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index c84dab1345..3b4bf6b66c 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1519,7 +1519,9 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
router->nickname, router->contact_info ? router->contact_info : "",
router->platform ? router->platform : "");
} else {
- info(LD_DIR,"'%s' may be unreachable -- the %d previous descriptors were thought to be unreachable.", router->nickname, router->num_unreachable_notifications);
+ info(LD_DIR,"'%s' may be unreachable -- the %d previous "
+ "descriptors were thought to be unreachable.",
+ router->nickname, router->num_unreachable_notifications);
router->num_unreachable_notifications++;
}
}
@@ -1913,7 +1915,9 @@ router_set_networkstatus(const char *s, time_t arrived_at,
format_iso_time(published, ns->published_on);
if (ns->published_on > now + NETWORKSTATUS_ALLOW_SKEW) {
- warn(LD_GENERAL, "Network status from %s was published in the future (%s GMT). Somebody is skewed here: check your clock. Not caching.", trusted_dir->description, published);
+ warn(LD_GENERAL, "Network status from %s was published in the future "
+ "(%s GMT). Somebody is skewed here: check your clock. Not caching.",
+ trusted_dir->description, published);
skewed = 1;
}