aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-08-11 20:22:48 +0000
committerRoger Dingledine <arma@torproject.org>2003-08-11 20:22:48 +0000
commit681c7539ef9a7ec3b0b2e6c1da551397820f7589 (patch)
tree4d960c0b1f368a4cd39180a0c1e186214892cc71 /src/or
parent17a311d9a00fe8ba9fc6288eafeb00e4bc1e8c12 (diff)
downloadtor-681c7539ef9a7ec3b0b2e6c1da551397820f7589.tar
tor-681c7539ef9a7ec3b0b2e6c1da551397820f7589.tar.gz
better log output for debugging
svn:r375
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuit.c4
-rw-r--r--src/or/main.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c
index a3fd62d29..9cbe660e2 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -805,7 +805,9 @@ int circuit_extend(cell_t *cell, circuit_t *circ) {
/* note also that this will close circuits where the onion has the same
* router twice in a row in the path. i think that's ok. -RD
*/
- log_fn(LOG_DEBUG,"Next router not connected. Closing.");
+ struct in_addr in;
+ in.s_addr = htonl(circ->n_addr);
+ log_fn(LOG_DEBUG,"Next router (%s:%d) not connected. Closing.", inet_ntoa(in), circ->n_port);
/* XXX later we should fail more gracefully here, like with a 'truncated' */
return -1;
}
diff --git a/src/or/main.c b/src/or/main.c
index 5853fd6ce..f3520a8c7 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -10,6 +10,9 @@ static void dumpstats(void); /* dump stats to stdout */
/********* START VARIABLES **********/
+extern char *conn_type_to_string[];
+extern char *conn_state_to_string[][15];
+
or_options_t options; /* command-line and config-file options */
int global_read_bucket; /* max number of bytes I can read this second */
@@ -269,7 +272,7 @@ static void conn_read(int i) {
}
if(retval < 0) { /* this connection is broken. remove it */
- log_fn(LOG_INFO,"Connection broken, removing.");
+ log_fn(LOG_INFO,"%s connection broken, removing.", conn_type_to_string[conn->type]);
connection_remove(conn);
connection_free(conn);
if(i<nfds) { /* we just replaced the one at i with a new one.
@@ -300,7 +303,7 @@ static void conn_write(int i) {
}
if(retval < 0) { /* this connection is broken. remove it. */
- log_fn(LOG_DEBUG,"Connection broken, removing.");
+ log_fn(LOG_DEBUG,"%s connection broken, removing.", conn_type_to_string[conn->type]);
connection_remove(conn);
connection_free(conn);
if(i<nfds) { /* we just replaced the one at i with a new one.
@@ -597,8 +600,6 @@ static void dumpstats(void) { /* dump stats to stdout */
int i;
connection_t *conn;
struct timeval now;
- extern char *conn_type_to_string[];
- extern char *conn_state_to_string[][15];
printf("Dumping stats:\n");
my_gettimeofday(&now);