summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuituse.c4
-rw-r--r--src/or/config.c24
-rw-r--r--src/or/connection_edge.c65
-rw-r--r--src/or/control.c2
-rw-r--r--src/or/directory.c2
-rw-r--r--src/or/dns.c2
-rw-r--r--src/or/main.c4
-rw-r--r--src/or/routerlist.c2
8 files changed, 52 insertions, 53 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 330f782eff..9c4867f09b 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1216,11 +1216,11 @@ connection_ap_handshake_attach_chosen_circuit(edge_connection_t *conn,
consider_recording_trackhost(conn, circ);
/* fall through */
case SOCKS_COMMAND_CONNECT_DIR:
- if (connection_ap_handshake_send_begin(conn)<0)
+ if (connection_ap_handshake_send_begin(conn) < 0)
return -1;
break;
default:
- if (connection_ap_handshake_send_resolve(conn)<0)
+ if (connection_ap_handshake_send_resolve(conn) < 0)
return -1;
}
diff --git a/src/or/config.c b/src/or/config.c
index a0385bb324..71f18f314a 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -899,8 +899,8 @@ options_act(or_options_t *old_options)
if (options->DirServers) {
for (cl = options->DirServers; cl; cl = cl->next) {
if (parse_dir_server_line(cl->value, 0)<0) {
- log_err(LD_BUG,
- "Previously validated DirServer line could not be added!");
+ log_warn(LD_BUG,
+ "Previously validated DirServer line could not be added!");
return -1;
}
}
@@ -912,15 +912,15 @@ options_act(or_options_t *old_options)
if (options->Bridges) {
for (cl = options->Bridges; cl; cl = cl->next) {
if (parse_bridge_line(cl->value, 0)<0) {
- log_err(LD_BUG,
- "Previously validated Bridge line could not be added!");
+ log_warn(LD_BUG,
+ "Previously validated Bridge line could not be added!");
return -1;
}
}
}
if (running_tor && rend_config_services(options, 0)<0) {
- log_err(LD_BUG,
+ log_warn(LD_BUG,
"Previously validated hidden services line could not be added!");
return -1;
}
@@ -931,8 +931,8 @@ options_act(or_options_t *old_options)
tor_snprintf(fn, len, "%s"PATH_SEPARATOR"cached-status",
options->DataDirectory);
if (check_private_dir(fn, CPD_CREATE) != 0) {
- log_err(LD_CONFIG,
- "Couldn't access/create private data directory \"%s\"", fn);
+ log_warn(LD_CONFIG,
+ "Couldn't access/create private data directory \"%s\"", fn);
tor_free(fn);
return -1;
}
@@ -984,13 +984,13 @@ options_act(or_options_t *old_options)
/* reload keys as needed for rendezvous services. */
if (rend_service_load_keys()<0) {
- log_err(LD_GENERAL,"Error loading rendezvous service keys");
+ log_warn(LD_GENERAL,"Error loading rendezvous service keys");
return -1;
}
/* Set up accounting */
if (accounting_parse_options(options, 0)<0) {
- log_err(LD_CONFIG,"Error in accounting options");
+ log_warn(LD_CONFIG,"Error in accounting options");
return -1;
}
if (accounting_is_enabled(options))
@@ -1013,7 +1013,7 @@ options_act(or_options_t *old_options)
"Worker-related options changed. Rotating workers.");
if (server_mode(options) && !server_mode(old_options)) {
if (init_keys() < 0) {
- log_err(LD_BUG,"Error initializing keys; exiting");
+ log_warn(LD_BUG,"Error initializing keys; exiting");
return -1;
}
ip_address_changed(0);
@@ -3689,7 +3689,7 @@ normalize_data_directory(or_options_t *options)
if (strncmp(d,"~/",2) == 0) {
char *fn = expand_filename(d);
if (!fn) {
- log_err(LD_CONFIG,"Failed to expand filename \"%s\".", d);
+ log_warn(LD_CONFIG,"Failed to expand filename \"%s\".", d);
return -1;
}
if (!options->DataDirectory && !strcmp(fn,"/.tor")) {
@@ -3719,7 +3719,7 @@ validate_data_directory(or_options_t *options)
return -1;
tor_assert(options->DataDirectory);
if (strlen(options->DataDirectory) > (512-128)) {
- log_err(LD_CONFIG, "DataDirectory is too long.");
+ log_warn(LD_CONFIG, "DataDirectory is too long.");
return -1;
}
return 0;
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 913a9eecf1..f9b2ee52bf 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -29,8 +29,7 @@ static smartlist_t *redirect_exit_list = NULL;
static int connection_ap_handshake_process_socks(edge_connection_t *conn);
static int connection_ap_process_natd(edge_connection_t *conn);
-static int connection_exit_connect_dir(edge_connection_t *exit_conn,
- or_circuit_t *circ);
+static int connection_exit_connect_dir(edge_connection_t *exitconn);
static int hostname_is_noconnect_address(const char *address);
/** An AP stream has failed/finished. If it hasn't already sent back
@@ -2226,7 +2225,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
tor_assert(or_circ);
if (or_circ->p_conn && or_circ->p_conn->_base.addr)
n_stream->_base.addr = or_circ->p_conn->_base.addr;
- return connection_exit_connect_dir(n_stream, or_circ);
+ return connection_exit_connect_dir(n_stream);
}
log_debug(LD_EXIT,"about to start the dns_resolve().");
@@ -2393,57 +2392,57 @@ connection_exit_connect(edge_connection_t *edge_conn)
* bridge connection with a socketpair, create a new directory conn, and join
* them together. Return 0 on success (or if there was an error we could send
* back an end cell for). Return -(some circuit end reason) if the circuit
- * needs to be torn down. Either connects exit_conn, frees it, or marks it,
- * as appropriate.
+ * needs to be torn down. Either connects <b>exitconn<b/>, frees it,
+ * or marks it, as appropriate.
*
* DOCDOC no longer uses socketpair
*/
static int
-connection_exit_connect_dir(edge_connection_t *exit_conn,
- or_circuit_t *circ)
+connection_exit_connect_dir(edge_connection_t *exitconn)
{
- dir_connection_t *dir_conn = NULL;
+ dir_connection_t *dirconn = NULL;
+ or_circuit_t *circ = TO_OR_CIRCUIT(exitconn->on_circuit);
log_info(LD_EXIT, "Opening local connection for anonymized directory exit");
- exit_conn->_base.state = EXIT_CONN_STATE_OPEN;
+ exitconn->_base.state = EXIT_CONN_STATE_OPEN;
- dir_conn = TO_DIR_CONN(connection_new(CONN_TYPE_DIR));
+ dirconn = TO_DIR_CONN(connection_new(CONN_TYPE_DIR));
- dir_conn->_base.addr = 0x7f000001;
- dir_conn->_base.port = 0;
- dir_conn->_base.address = tor_strdup("Tor network");
- dir_conn->_base.type = CONN_TYPE_DIR;
- dir_conn->_base.purpose = DIR_PURPOSE_SERVER;
- dir_conn->_base.state = DIR_CONN_STATE_SERVER_COMMAND_WAIT;
+ dirconn->_base.addr = 0x7f000001;
+ dirconn->_base.port = 0;
+ dirconn->_base.address = tor_strdup("Tor network");
+ dirconn->_base.type = CONN_TYPE_DIR;
+ dirconn->_base.purpose = DIR_PURPOSE_SERVER;
+ dirconn->_base.state = DIR_CONN_STATE_SERVER_COMMAND_WAIT;
- connection_link_connections(TO_CONN(dir_conn), TO_CONN(exit_conn));
+ connection_link_connections(TO_CONN(dir_conn), TO_CONN(exitconn));
- if (connection_add(TO_CONN(exit_conn))<0) {
- connection_edge_end(exit_conn, END_STREAM_REASON_RESOURCELIMIT);
- connection_free(TO_CONN(exit_conn));
- connection_free(TO_CONN(dir_conn));
+ if (connection_add(TO_CONN(exitconn))<0) {
+ connection_edge_end(exitconn, END_STREAM_REASON_RESOURCELIMIT);
+ connection_free(TO_CONN(exitconn));
+ connection_free(TO_CONN(dirconn));
return 0;
}
- exit_conn->next_stream = circ->n_streams;
- circ->n_streams = exit_conn;
+ exitconn->next_stream = circ->n_streams;
+ circ->n_streams = exitconn;
- if (connection_add(TO_CONN(dir_conn))<0) {
- connection_edge_end(exit_conn, END_STREAM_REASON_RESOURCELIMIT);
- connection_close_immediate(TO_CONN(exit_conn));
- connection_mark_for_close(TO_CONN(exit_conn));
- connection_free(TO_CONN(dir_conn));
+ if (connection_add(TO_CONN(dirconn))<0) {
+ connection_edge_end(exitconn, END_STREAM_REASON_RESOURCELIMIT);
+ connection_close_immediate(TO_CONN(exitconn));
+ connection_mark_for_close(TO_CONN(exitconn));
+ connection_free(TO_CONN(dirconn));
return 0;
}
- connection_start_reading(TO_CONN(dir_conn));
- connection_start_reading(TO_CONN(exit_conn));
+ connection_start_reading(TO_CONN(dirconn));
+ connection_start_reading(TO_CONN(exitconn));
- if (connection_edge_send_command(exit_conn,
+ if (connection_edge_send_command(exitconn,
RELAY_COMMAND_CONNECTED, NULL, 0) < 0) {
- connection_mark_for_close(TO_CONN(exit_conn));
- connection_mark_for_close(TO_CONN(dir_conn));
+ connection_mark_for_close(TO_CONN(exitconn));
+ connection_mark_for_close(TO_CONN(dirconn));
return 0;
}
diff --git a/src/or/control.c b/src/or/control.c
index 4288d56588..355bad6e2c 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -7,7 +7,7 @@ const char control_c_id[] =
/**
* \file control.c
* \brief Implementation for Tor's control-socket interface.
- * See control-spec.txt for full details on protocol.
+ * See doc/spec/control-spec.txt for full details on protocol.
**/
#define CONTROL_PRIVATE
diff --git a/src/or/directory.c b/src/or/directory.c
index e03506a4f4..be71678c7f 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -647,7 +647,7 @@ directory_send_command(dir_connection_t *conn,
if (strlen(proxystring) + strlen(url) >= 4096) {
log_warn(LD_BUG,
- "Squid does not like URLs longer than 4095 bytes, this "
+ "Squid does not like URLs longer than 4095 bytes, and this "
"one is %d bytes long: %s%s",
(int)(strlen(proxystring) + strlen(url)), proxystring, url);
}
diff --git a/src/or/dns.c b/src/or/dns.c
index c6bb4703ce..665e0820b7 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -8,7 +8,7 @@ const char dns_c_id[] =
/**
* \file dns.c
* \brief Implements a local cache for DNS results for Tor servers.
- * This is implemetned as a wrapper around Adam Langley's eventdns.c code.
+ * This is implemented as a wrapper around Adam Langley's eventdns.c code.
* (We can't just use gethostbyname() and friends because we really need to
* be nonblocking.)
**/
diff --git a/src/or/main.c b/src/or/main.c
index 14ca11d068..41156faac1 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -515,8 +515,8 @@ conn_write_callback(int fd, short events, void *_conn)
if (!conn->marked_for_close) {
/* this connection is broken. remove it. */
log_fn(LOG_WARN,LD_BUG,
- "unhandled error on write for %s connection (fd %d); removing",
- conn_type_to_string(conn->type), conn->s);
+ "unhandled error on write for %s connection (fd %d); removing",
+ conn_type_to_string(conn->type), conn->s);
tor_fragile_assert();
if (CONN_IS_EDGE(conn)) {
/* otherwise we cry wolf about duplicate close */
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 12161779d9..d14db33a8a 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4344,7 +4344,7 @@ update_router_descriptor_cache_downloads(time_t now)
continue;
if (router_get_by_descriptor_digest(rs->descriptor_digest)) {
log_warn(LD_BUG,
- "We have a router descriptor, but need_to_mirror=1.");
+ "We have a router descriptor, but need_to_mirror=1.");
rs->need_to_mirror = 0;
continue;
}