aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-09-26 10:03:50 +0000
committerRoger Dingledine <arma@torproject.org>2003-09-26 10:03:50 +0000
commit9e5cafc395397426030e8098d64b8e25625863c5 (patch)
treea92b2c34d62a5673746387e1b10e42788e1838ef /src/or/connection_or.c
parentdb2684149eb0b1528e0b545303ad4db69a0ed584 (diff)
downloadtor-9e5cafc395397426030e8098d64b8e25625863c5.tar.gz
tor-9e5cafc395397426030e8098d64b8e25625863c5.zip
first pass: obey log convention
ERR is if something fatal just happened WARNING is something bad happened, but we're still running. The bad thing is either a bug in the code, an attack or buggy protocol/implementation of the remote peer, etc. The operator should examine the bad thing and try to correct it. (No error or warning messages should be expected. I expect most people to run on -l warning eventually.) NOTICE is never ever used. INFO means something happened (maybe bad, maybe ok), but there's nothing you need to (or can) do about it. DEBUG is for everything louder than INFO. svn:r486
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index d49667ddeb..bdee553bbf 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -31,7 +31,7 @@ int connection_or_process_inbuf(connection_t *conn) {
assert(conn && conn->type == CONN_TYPE_OR);
if(conn->inbuf_reached_eof) {
- log_fn(LOG_DEBUG,"conn reached eof. Closing.");
+ log_fn(LOG_INFO,"conn reached eof. Closing.");
return -1;
}
@@ -57,16 +57,17 @@ int connection_or_finished_flushing(connection_t *conn) {
}
/* the connect has finished. */
- log_fn(LOG_DEBUG,"OR connect() to router %s:%u finished.",
+ log_fn(LOG_INFO,"OR connect() to router %s:%u finished.",
conn->address,conn->port);
if(connection_tls_start_handshake(conn, 0) < 0)
return -1;
+ return 0;
case OR_CONN_STATE_OPEN:
connection_stop_writing(conn);
return 0;
default:
- log_fn(LOG_ERR,"BUG: called in unexpected state.");
+ log_fn(LOG_WARNING,"BUG: called in unexpected state.");
return 0;
}
}
@@ -91,7 +92,7 @@ connection_t *connection_or_connect(routerinfo_t *router) {
assert(router);
if(router_is_me(router->addr, router->or_port)) {
- /* this is me! don't connect to me. */
+ /* this is me! don't connect to me. XXX use nickname/key */
log(LOG_DEBUG,"connection_or_connect(): This is me. Skipping.");
return NULL;
}
@@ -104,6 +105,7 @@ connection_t *connection_or_connect(routerinfo_t *router) {
conn = connection_new(CONN_TYPE_OR);
if(!conn) {
+ log_fn(LOG_WARNING,"connection_new failed; skipping.");
return NULL;
}