summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-09 20:04:00 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-09 20:04:00 +0000
commit5a5be93f80a3cdb3d72311ece04ccc510c15626c (patch)
treee8c93b2cc57de810b0dfb0dc35a90727be4a57dc
parentd9d053d70b23ef46610867298dabdec579cef9c4 (diff)
downloadtor-5a5be93f80a3cdb3d72311ece04ccc510c15626c.tar.gz
tor-5a5be93f80a3cdb3d72311ece04ccc510c15626c.zip
Normalize whitespace; add a "tell me about all the unnormalized whitespace" target; fix a braino in dirserv.c
svn:r2758
-rw-r--r--Makefile.am8
-rwxr-xr-xcontrib/checkSpace.pl25
-rw-r--r--src/common/compat.c3
-rw-r--r--src/common/crypto.c2
-rw-r--r--src/common/log.c3
-rw-r--r--src/common/log.h2
-rw-r--r--src/common/torint.h3
-rw-r--r--src/common/tortls.c1
-rw-r--r--src/common/util.c17
-rw-r--r--src/or/config.c5
-rw-r--r--src/or/connection.c6
-rw-r--r--src/or/connection_edge.c5
-rw-r--r--src/or/directory.c3
-rw-r--r--src/or/dirserv.c8
-rw-r--r--src/or/hibernate.c2
-rw-r--r--src/or/main.c3
-rw-r--r--src/or/or.h3
-rw-r--r--src/or/relay.c4
-rw-r--r--src/or/rendclient.c1
-rw-r--r--src/or/rendcommon.c1
-rw-r--r--src/or/rendmid.c1
-rw-r--r--src/or/rephist.c3
-rw-r--r--src/or/router.c1
-rw-r--r--src/or/routerlist.c8
-rw-r--r--src/or/routerparse.c10
-rw-r--r--src/or/test.c6
-rw-r--r--src/tools/tor-resolve.c8
27 files changed, 65 insertions, 77 deletions
diff --git a/Makefile.am b/Makefile.am
index 785b88eb83..bcb3f22252 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,3 +24,11 @@ dist-rpm: dist
doxygen:
doxygen && cd doc/doxygen/latex && make
+
+# Avoid strlcpy.c, strlcat.c, tree.h
+check-spaces:
+ ./contrib/checkSpace.pl \
+ src/common/*.h \
+ src/common/[^s]*.c \
+ src/or/[^t]*.[ch] src/or/t*.c
+
diff --git a/contrib/checkSpace.pl b/contrib/checkSpace.pl
new file mode 100755
index 0000000000..435df10601
--- /dev/null
+++ b/contrib/checkSpace.pl
@@ -0,0 +1,25 @@
+#!/usr/bin/perl -w
+
+for $fn (@ARGV) {
+ open(F, "$fn");
+ $lastnil = 0;
+ while (<F>) {
+ if (/\r/) {
+ print " CR:$fn:$.\n";
+ }
+ if (/\t/) {
+ print " TAB:$fn:$.\n";
+ }
+ if (/ +$/) {
+ print "Space\@EOL:$fn:$.\n";
+ }
+ if ($lastnil && /^$/) {
+ print " DoubleNL:$fn:$.\n";
+ } elsif (/^$/) {
+ $lastnil = 1;
+ } else {
+ $lastnil = 0;
+ }
+ }
+ close(F);
+}
diff --git a/src/common/compat.c b/src/common/compat.c
index 457b798f7e..0b67820c6c 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -2,7 +2,6 @@
/* See LICENSE for licensing information */
/* $Id$ */
-
/* This is required on rh7 to make strptime not complain.
*/
#define _GNU_SOURCE
@@ -488,7 +487,6 @@ void spawn_exit()
#endif
}
-
/** Set *timeval to the current time of day. On error, log and terminate.
* (Same as gettimeofday(timeval,NULL), but never returns -1.)
*/
@@ -560,7 +558,6 @@ void tor_mutex_release(tor_mutex_t *m)
}
#endif
-
/**
* On Windows, WSAEWOULDBLOCK is not always correct: when you see it,
* you need to ask the socket for its actual errno. Also, you need to
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 6b5c952be5..e779ceeade 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -99,7 +99,6 @@ RSA *_crypto_pk_env_get_rsa(crypto_pk_env_t *env);
EVP_PKEY *_crypto_pk_env_get_evp_pkey(crypto_pk_env_t *env, int private);
DH *_crypto_dh_env_get_dh(crypto_dh_env_t *dh);
-
/** Return the number of bytes added by padding method <b>padding</b>.
*/
static INLINE int
@@ -739,7 +738,6 @@ crypto_pk_private_sign_digest(crypto_pk_env_t *env, unsigned char *to,
return crypto_pk_private_sign(env,to,digest,DIGEST_LEN);
}
-
/** Perform a hybrid (public/secret) encryption on <b>fromlen</b>
* bytes of data from <b>from</b>, with padding type 'padding',
* storing the results on <b>to</b>.
diff --git a/src/common/log.c b/src/common/log.c
index c61d0a5d4a..7e351aed2a 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -124,7 +124,7 @@ static INLINE char *format_msg(char *buf, size_t buf_len,
else
n += r;
}
-
+
r = tor_vsnprintf(buf+n,buf_len-n,format,ap);
if(r < 0) {
n = buf_len-2;
@@ -413,7 +413,6 @@ int get_min_log_level(void)
return min;
}
-
/*
Local Variables:
mode:c
diff --git a/src/common/log.h b/src/common/log.h
index c2a4ea176f..2f90ce8c48 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -27,7 +27,7 @@
/* XXXX Note: The code was originally written to refer to severities,
* with 0 being the least severe; while syslog's logging code refers to
* priorities, with 0 being the most important. Thus, all our comparisons
- * needed to be reversed when we added syslog support.
+ * needed to be reversed when we added syslog support.
*
* The upshot of this is that comments about log levels may be messed
* up: for "maximum severity" read "most severe" and "numerically
diff --git a/src/common/torint.h b/src/common/torint.h
index aec8d686ea..359f510d5a 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -33,7 +33,6 @@
#endif
#endif
-
#if (SIZEOF_INT8_T != 0)
#define HAVE_INT8_T
#endif
@@ -87,7 +86,6 @@ typedef unsigned short uint16_t;
#endif
#endif
-
#if (SIZEOF_INT == 2)
#ifndef HAVE_INT16_T
typedef signed int int16_t;
@@ -111,7 +109,6 @@ typedef unsigned int uint32_t;
#endif
#endif
-
#if (SIZEOF_LONG == 4)
#ifndef HAVE_INT32_T
typedef signed long int32_t;
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 051b9887df..a881ac575b 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -257,7 +257,6 @@ tor_tls_create_certificate(crypto_pk_env_t *rsa,
return x509;
}
-
#ifdef EVERYONE_HAS_AES
/* Everybody is running OpenSSL 0.9.7 or later, so no backward compatibility
* is needed. */
diff --git a/src/common/util.c b/src/common/util.c
index d045de9c74..fbb92c0a4d 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -295,7 +295,6 @@ int strcmpend(const char *s1, const char *s2)
return strncmp(s1+(n1-n2), s2, n2);
}
-
/** Return a pointer to the first char of s that is not whitespace and
* not a comment, or to the terminating NUL if no such character exists.
*/
@@ -351,8 +350,7 @@ const char *find_whitespace(const char *s) {
err: \
if (ok) *ok = 0; \
if (next) *next = endptr; \
- return 0; \
-
+ return 0;
/** Extract a long from the start of s, in the given numeric base. If
* there is unconverted data and next is provided, set *next to the
@@ -413,8 +411,6 @@ tor_parse_uint64(const char *s, int base, uint64_t min,
CHECK_STRTOX_RESULT();
}
-
-
void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen)
{
const char *end;
@@ -469,7 +465,6 @@ int base16_decode(char *dest, size_t destlen, const char *src, size_t srclen)
return 0;
}
-
/* =====
* Time
* ===== */
@@ -527,7 +522,6 @@ void tv_addms(struct timeval *a, long ms) {
a->tv_usec %= 1000000;
}
-
#define IS_LEAPYEAR(y) (!(y % 4) && ((y % 100) || !(y % 400)))
static int n_leapdays(int y1, int y2) {
--y1;
@@ -789,8 +783,9 @@ int
write_str_to_file(const char *fname, const char *str, int bin)
{
#ifdef MS_WINDOWS
- if (strchr(str, '\r')) {
- log_fn(LOG_WARN, "How odd. Writing a string that does contain CR already.");
+ if (!bin && strchr(str, '\r')) {
+ log_fn(LOG_WARN,
+ "How odd. Writing a string that does contain CR already.");
}
#endif
return write_bytes_to_file(fname, str, strlen(str), bin);
@@ -865,7 +860,7 @@ char *read_file_to_str(const char *filename, int bin) {
return NULL;
}
string[r] = '\0'; /* NUL-terminate the result. */
-
+
if (bin && r != statbuf.st_size) {
/* If we're in binary mode, then we'd better have an exact match for
* size. Otherwise, win32 encoding may throw us off, and that's okay. */
@@ -878,7 +873,7 @@ char *read_file_to_str(const char *filename, int bin) {
#ifdef MS_WINDOWS
if (!bin && strchr(string, '\r')) {
log_fn(LOG_DEBUG, "We didn't convert CRLF to LF as well as we hoped when reading %s. Coping.",
- filename);
+ filename);
tor_strstrip(string, "\r");
}
#endif
diff --git a/src/or/config.c b/src/or/config.c
index 741f86f2b3..d3e74211ce 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -765,7 +765,7 @@ option_reset(or_options_t *options, config_var_t *var)
}
}
-/** Set <b>options</b>-&gt;DirServers to contain the default directory
+/** Set <b>options</b>-&gt;DirServers to contain the default directory
* servers. */
static void
add_default_trusted_dirservers(or_options_t *options)
@@ -1317,7 +1317,6 @@ static int check_nickname_list(const char *lst, const char *name)
return r;
}
-
/** Read a configuration file into <b>options</b>, finding the configuration
* file location based on the command line. After loading the options,
* validate them for consistency, then take actions based on them.
@@ -1840,7 +1839,6 @@ parse_dir_server_line(const char *line, int validate_only)
return r;
}
-
/** Adjust or the value of options->DataDirectory, or fill it in if it's
* absent. Return 0 on success, -1 on failure. */
static int
@@ -1894,7 +1892,6 @@ validate_data_directory(or_options_t *options) {
return 0;
}
-
/*
Local Variables:
mode:c
diff --git a/src/or/connection.c b/src/or/connection.c
index 9ab7f25f02..fccb2ddaa4 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -405,7 +405,7 @@ static int connection_handle_listener_read(connection_t *conn, int new_type) {
return 0;
}
/* else there was a real error. */
- log_fn(LOG_WARN,"accept() failed: %s. Closing listener.",
+ log_fn(LOG_WARN,"accept() failed: %s. Closing listener.",
tor_socket_strerror(e));
connection_mark_for_close(conn);
return -1;
@@ -570,7 +570,7 @@ static void listener_close_if_present(int type) {
}
}
-/**
+/**
* Launch any configured listener connections of type <b>type</b>. (A
* listener is configured if <b>port_option</b> is non-zero. If any
* BindAddress configuration options are given in <b>cfg</b>, create a
@@ -578,7 +578,7 @@ static void listener_close_if_present(int type) {
* connection binding to the address <b>default_addr</b>.)
*
* If <b>force</b> is true, close and re-open all listener connections.
- * Otherwise, only relaunch the listeners of this type if the number of
+ * Otherwise, only relaunch the listeners of this type if the number of
* existing connections is not as configured (e.g., because one died).
*/
static int retry_listeners(int type, struct config_line_t *cfg,
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 2a4cd4f1b9..9e91a639c5 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -203,7 +203,6 @@ int connection_edge_finished_connecting(connection_t *conn)
tor_assert(conn->type == CONN_TYPE_EXIT);
tor_assert(conn->state == EXIT_CONN_STATE_CONNECTING);
-
log_fn(LOG_INFO,"Exit connection to %s:%u established.",
conn->address,conn->port);
@@ -858,7 +857,6 @@ int connection_exit_begin_resolve(cell_t *cell, circuit_t *circ) {
assert_circuit_ok(circ);
relay_header_unpack(&rh, cell->payload);
-
/* This 'dummy_conn' only exists to remember the stream ID
* associated with the resolve request; and to make the
* implementation of dns.c more uniform. (We really only need to
@@ -880,7 +878,7 @@ int connection_exit_begin_resolve(cell_t *cell, circuit_t *circ) {
/* send it off to the gethostbyname farm */
switch(dns_resolve(dummy_conn)) {
case 1: /* The result was cached; a resolved cell was sent. */
- case -1:
+ case -1:
circuit_detach_stream(circuit_get_by_conn(dummy_conn), dummy_conn);
connection_free(dummy_conn);
return 0;
@@ -1203,7 +1201,6 @@ void client_dns_clean(void)
strmap_foreach(client_dns_map, (strmap_foreach_fn)_remove_if_expired, &now);
}
-
/** Make connection redirection follow the provided list of
* exit_redirect_t */
void
diff --git a/src/or/directory.c b/src/or/directory.c
index 4a62335d82..8d11cbf87a 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -178,7 +178,6 @@ directory_get_from_dirserver(uint8_t purpose, const char *payload,
log_fn(LOG_WARN,"No running dirservers known. Not trying. (purpose %d)", purpose);
}
-
/** Launch a new connection to the directory server <b>router</b> to upload or
* download a service or rendezvous descriptor. <b>purpose</b> determines what
* kind of directory connection we're launching, and must be one of
@@ -755,7 +754,7 @@ directory_handle_command_get(connection_t *conn, char *headers,
return 0;
}
- log_fn(LOG_DEBUG,"Dumping %sdirectory to client.",
+ log_fn(LOG_DEBUG,"Dumping %sdirectory to client.",
deflated?"deflated ":"");
format_rfc1123_time(date, time(NULL));
tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: text/plain\r\nContent-Encoding: %s\r\n\r\n",
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 9a11f0bdb9..f05e4088b8 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -119,7 +119,7 @@ dirserv_parse_fingerprint_file(const char *fname)
nickname, fingerprint);
continue;
}
- if (0==strcasecmp(ent->nickname, DEFAULT_CLIENT_NICKNAME)) {
+ if (0==strcasecmp(nickname, DEFAULT_CLIENT_NICKNAME)) {
/* If you approved an OR called "client", then clients who use
* the default nickname could all be rejected. That's no good. */
log(LOG_WARN,
@@ -465,7 +465,7 @@ dirserv_load_from_directory_string(const char *dir)
/**
* Allocate and return a description of the status of the server <b>desc</b>,
* for use in a running-routers line (if <b>rr_format</b> is true), or in a
- * router-status line (if <b>rr_format</b> is false. The server is listed
+ * router-status line (if <b>rr_format</b> is false. The server is listed
* as running iff <b>is_live</b> is true.
*/
static char *
@@ -617,14 +617,14 @@ dirserv_dump_directory_to_string(char *s, size_t maxlen,
struct config_line_t *ln;
versions = smartlist_create();
for (ln = get_options()->RecommendedVersions; ln; ln = ln->next) {
- smartlist_split_string(versions, ln->value, ",",
+ smartlist_split_string(versions, ln->value, ",",
SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
}
recommended_versions = smartlist_join_strings(versions,",",0,NULL);
SMARTLIST_FOREACH(versions,char *,s,tor_free(s));
smartlist_free(versions);
}
-
+
dirserv_remove_old_servers(ROUTER_MAX_AGE);
published_on = time(NULL);
format_iso_time(published, published_on);
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index b604ef4f6e..40b30aa2ff 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -146,7 +146,6 @@ start_of_accounting_period_containing(time_t now)
return tor_timegm(tm);
}
-
/** Return the start of the accounting period that comes after the one
* containing the time <b>now</b>. */
static time_t
@@ -161,7 +160,6 @@ start_of_accounting_period_after(time_t now)
return tor_timegm(tm);
}
-
/** Initialize the accounting subsystem. */
void
configure_accounting(time_t now)
diff --git a/src/or/main.c b/src/or/main.c
index 4a2e9cc085..9ffcbf9d15 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -372,7 +372,6 @@ void directory_has_arrived(time_t now) {
}
}
-
/** Perform regular maintenance tasks for a single connection. This
* function gets run once per second per connection by run_housekeeping.
*/
@@ -595,7 +594,6 @@ static void run_scheduled_events(time_t now) {
*/
connection_ap_expire_beginning();
-
/** 3c. And expire connections that we've held open for too long.
*/
connection_expire_held_open();
@@ -990,7 +988,6 @@ void handle_signals(int is_parent)
#endif /* signal stuff */
}
-
/** Main entry point for the Tor command-line client.
*/
static int tor_init(int argc, char *argv[]) {
diff --git a/src/or/or.h b/src/or/or.h
index 4ab2d23ce6..7fb8340074 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -97,7 +97,6 @@
#include <time.h>
#endif
-
#ifdef MS_WINDOWS
#if (_MSC_VER <= 1300)
#include <winsock.h>
@@ -719,7 +718,6 @@ typedef struct {
int failure_count;
} cpath_build_state_t;
-
#define CIRCUIT_MAGIC 0x35315243u
/** Struct for a path (circuit) through the onion routing network. */
struct circuit_t {
@@ -1578,7 +1576,6 @@ int router_update_status_from_smartlist(routerinfo_t *r,
void add_trusted_dir_server(const char *addr, uint16_t port,const char *digest);
void clear_trusted_dir_servers(void);
-
/********************************* routerparse.c ************************/
typedef struct tor_version_t {
diff --git a/src/or/relay.c b/src/or/relay.c
index e5fe9d0ebf..b5ee04ade9 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -526,8 +526,8 @@ connection_edge_process_relay_cell_not_open(
if(connection_ap_can_use_exit(conn, exitrouter)) {
log_fn(LOG_WARN,"Exitrouter %s seems to be more restrictive than its exit policy. Not using this router as exit for now,", exitrouter->nickname);
exit_policy_free(exitrouter->exit_policy);
- exitrouter->exit_policy =
- router_parse_exit_policy_from_string("reject *:*");
+ exitrouter->exit_policy =
+ router_parse_exit_policy_from_string("reject *:*");
}
conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 75d6f33189..b95d0cb794 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -235,7 +235,6 @@ rend_client_introduction_acked(circuit_t *circ,
return 0;
}
-
/** If we are not currently fetching a rendezvous service descriptor
* for the service ID <b>query</b>, start a directory connection to fetch a
* new one.
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index 1f14e3fe3e..559f210985 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -10,7 +10,6 @@
#include "or.h"
-
/** Return 0 if one and two are the same service ids, else -1 or 1 */
int rend_cmp_service_ids(const char *one, const char *two) {
return strcasecmp(one,two);
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index 457b1dcf16..02394d8d3d 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -209,7 +209,6 @@ rend_mid_establish_rendezvous(circuit_t *circ, const char *request, size_t reque
circ->purpose = CIRCUIT_PURPOSE_REND_POINT_WAITING;
memcpy(circ->rend_cookie, request, REND_COOKIE_LEN);
-
base16_encode(hexid,9,request,4);
log_fn(LOG_INFO, "Established rendezvous point on circuit %d for cookie %s",
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 94cd11cd25..bd1adcf473 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -280,7 +280,7 @@ void rep_hist_dump_stats(time_t now, int severity)
name2 = "(unknown)";
link_history = (link_history_t*) link_history_p;
-
+
ret = tor_snprintf(buffer+len, 2048-len, "%s(%ld/%ld); ", name2,
link_history->n_extend_ok,
link_history->n_extend_ok+link_history->n_extend_fail);
@@ -556,7 +556,6 @@ rep_hist_get_bandwidth_lines(void)
return buf;
}
-
/*
Local Variables:
mode:c
diff --git a/src/or/router.c b/src/or/router.c
index 0d8ff88721..d2a6fe56ba 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -801,7 +801,6 @@ int is_legal_nickname_or_hexdigest(const char *s)
return len == HEX_DIGEST_LEN+1 && strspn(s+1,HEX_CHARACTERS)==len-1;
}
-
/*
Local Variables:
mode:c
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 5ae522ac32..33a409a893 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -273,7 +273,6 @@ void routerlist_add_family(smartlist_t *sl, routerinfo_t *router) {
});
});
-
for (cl = get_options()->NodeFamilies; cl; cl = cl->next) {
if (router_nickname_is_in_list(router, cl->value)) {
add_nickname_list_to_smartlist(sl, cl->value, 0);
@@ -835,7 +834,6 @@ routerlist_remove_old_routers(int age)
* Code to parse router descriptors and directories.
*/
-
/** Add to the current routerlist each router stored in the
* signed directory <b>s</b>. If pkey is provided, check the signature against
* pkey; else check against the pkey of the signing directory server. */
@@ -1044,7 +1042,7 @@ void routerlist_update_from_runningrouters(routerlist_t *list,
all_routers = smartlist_create();
if(me) /* learn if the dirservers think I'm verified */
smartlist_add(all_routers, me);
-
+
smartlist_add_all(all_routers,list->routers);
SMARTLIST_FOREACH(rr->running_routers, const char *, cp,
routers_update_status_from_entry(all_routers, rr->published_on,
@@ -1060,10 +1058,10 @@ void routerlist_update_from_runningrouters(routerlist_t *list,
* (running-routers format)
* <li> !<b>nickname</b> -- router is not-running and verified.
* (running-routers format)
- * <li> <b>nickname</b>=$<b>hexdigest</b> -- router is running and
+ * <li> <b>nickname</b>=$<b>hexdigest</b> -- router is running and
* verified. (router-status format)
* (router-status format)
- * <li> !<b>nickname</b>=$<b>hexdigest</b> -- router is running and
+ * <li> !<b>nickname</b>=$<b>hexdigest</b> -- router is running and
* verified. (router-status format)
* <li> !<b>nickname</b> -- router is not-running and verified.
* <li> $<b>hexdigest</b> -- router is running and unverified.
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 59b4fac277..bbfcda4245 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -422,7 +422,7 @@ router_parse_routerlist_from_directory(const char *str,
* router. */
str = end;
if (router_parse_list_from_string(&str, &new_dir,
- good_nickname_list,
+ good_nickname_list,
tok->tp==K_RUNNING_ROUTERS,
published_on)) {
log_fn(LOG_WARN, "Error reading routers from directory");
@@ -736,7 +736,6 @@ router_parse_list_from_string(const char **s, routerlist_t **dest,
return 0;
}
-
/** Helper function: reads a single router entry from *<b>s</b> ...
* *<b>end</b>. Mallocs a new router and returns it if all goes well, else
* returns NULL.
@@ -895,7 +894,6 @@ routerinfo_t *router_parse_entry_from_string(const char *s,
log_fn(LOG_WARN,"Error in exit policy"); goto err;}
);
-
if ((tok = find_first_by_keyword(tokens, K_FAMILY)) && tok->n_args) {
int i;
router->declared_family = smartlist_create();
@@ -907,7 +905,7 @@ routerinfo_t *router_parse_entry_from_string(const char *s,
smartlist_add(router->declared_family, tor_strdup(tok->args[i]));
}
}
-
+
if (!(tok = find_first_by_keyword(tokens, K_ROUTER_SIGNATURE))) {
log_fn(LOG_WARN, "Missing router signature"); goto err;
}
@@ -945,7 +943,6 @@ routerinfo_t *router_parse_entry_from_string(const char *s,
router->or_port, router->socks_port, router->dir_port,
(unsigned) router->bandwidthrate, (unsigned) router->bandwidthburst);
-
goto done;
return router;
@@ -1016,7 +1013,6 @@ int router_add_exit_policy_from_string(routerinfo_t *router, const char *s)
return 0;
}
-
static int router_add_exit_policy(routerinfo_t *router,directory_token_t *tok)
{
struct exit_policy_t *newe, **tmpe;
@@ -1056,7 +1052,6 @@ router_parse_exit_policy(directory_token_t *tok) {
if (parse_addr_and_port_range(arg, &newe->addr, &newe->msk,
&newe->prt_min, &newe->prt_max))
goto policy_read_failed;
-
in.s_addr = htonl(newe->addr);
address = tor_strdup(inet_ntoa(in));
@@ -1302,7 +1297,6 @@ get_next_token(const char **s, where_syntax where) {
fputs("\n",stdout);
#endif
-
return tok;
#undef RET_ERR
}
diff --git a/src/or/test.c b/src/or/test.c
index be088e5f84..6ad2249dc9 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -625,7 +625,6 @@ test_util(void) {
test_eq(2, smartlist_len(sl));
test_streq("efgh", smartlist_get(sl, 1));
-
/* Test tor_strstrip() */
strcpy(buf, "Testing 1 2 3");
test_eq(0, tor_strstrip(buf, ",!"));
@@ -779,7 +778,7 @@ test_gzip(void)
tor_free(buf1);
}
-static void *
+static void *
_squareAndRemoveK4(const char *key, void*val, void *data)
{
int *ip = (int*)data;
@@ -867,7 +866,7 @@ test_strmap(void)
strmap_free(map,NULL);
}
-static void
+static void
test_onion(void)
{
#if 0
@@ -929,7 +928,6 @@ test_onion_handshake(void)
crypto_free_pk_env(pk);
}
-
static void
test_dir_format(void)
{
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index d451ceb40e..a12df00377 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -44,7 +44,7 @@
do { log_fn(LOG_ERR, "Error while %s: %s", act, \
tor_socket_strerror(tor_socket_errno(_s))); } while(0)
-static int
+static int
build_socks4a_resolve_request(char **out,
const char *username,
const char *hostname)
@@ -66,7 +66,7 @@ build_socks4a_resolve_request(char **out,
return len;
}
-static int
+static int
parse_socks4a_resolve_response(const char *response, size_t len,
uint32_t *addr_out)
{
@@ -88,7 +88,7 @@ parse_socks4a_resolve_response(const char *response, size_t len,
return 0;
}
-static int
+static int
do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport,
uint32_t *result_addr)
{
@@ -152,7 +152,7 @@ do_resolve(const char *hostname, uint32_t sockshost, uint16_t socksport,
return 0;
}
-static void
+static void
usage(void)
{
puts("Syntax: tor-resolve [-v] hostname [sockshost:socksport]");