diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-03-11 06:19:08 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-03-11 06:19:08 +0000 |
commit | 9b4203266e7e0e7d162bde0063281d0ab6e0b415 (patch) | |
tree | f8e81d34b49dca09d622fcb1efee4914d8c6d26e /src/or/main.c | |
parent | 59e2c77824840f8cd5706c4ae660bc7f50bab0f1 (diff) | |
download | tor-9b4203266e7e0e7d162bde0063281d0ab6e0b415.tar tor-9b4203266e7e0e7d162bde0063281d0ab6e0b415.tar.gz |
Make OP work on windows! (Also misc logging tweaks)
svn:r1258
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/or/main.c b/src/or/main.c index e0777200c..fa7c6c849 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -69,7 +69,8 @@ int connection_add(connection_t *conn) { nfds++; - log(LOG_INFO,"connection_add(): new conn type %d, socket %d, nfds %d.",conn->type, conn->s, nfds); + log(LOG_INFO,"connection_add(): new conn type %s, socket %d, nfds %d.", + CONN_TYPE_TO_STRING(conn->type), conn->s, nfds); return 0; } @@ -88,7 +89,8 @@ int connection_remove(connection_t *conn) { assert(conn); assert(nfds>0); - log(LOG_INFO,"connection_remove(): removing socket %d, nfds now %d",conn->s, nfds-1); + log_fn(LOG_INFO,"removing socket %d (type %s), nfds now %d", + conn->s, CONN_TYPE_TO_STRING(conn->type), nfds-1); /* if it's an edge conn, remove it from the list * of conn's on this circuit. If it's not on an edge, * flush and send destroys for all circuits on this conn @@ -191,7 +193,7 @@ static void conn_read(int i) { /* XXX This shouldn't ever happen anymore. */ /* XXX but it'll clearly happen on MS_WINDOWS from POLLERR, right? */ log_fn(LOG_ERR,"Unhandled error on read for %s connection (fd %d); removing", - conn_type_to_string[conn->type], conn->s); + CONN_TYPE_TO_STRING(conn->type), conn->s); connection_mark_for_close(conn,0); } } @@ -215,7 +217,7 @@ static void conn_write(int i) { if (!conn->marked_for_close) { /* this connection is broken. remove it. */ log_fn(LOG_WARN,"Unhandled error on read for %s connection (fd %d); removing", - conn_type_to_string[conn->type], conn->s); + CONN_TYPE_TO_STRING(conn->type), conn->s); conn->has_sent_end = 1; /* otherwise we cry wolf about duplicate close */ connection_mark_for_close(conn,0); } @@ -238,9 +240,9 @@ static void conn_close_if_marked(int i) { * has already been closed as unflushable. */ if(!conn->hold_open_until_flushed) log_fn(LOG_WARN, - "Conn (fd %d, type %d, state %d) marked, but wants to flush %d bytes. " + "Conn (fd %d, type %s, state %d) marked, but wants to flush %d bytes. " "(Marked at %s:%d)", - conn->s, conn->type, conn->state, + conn->s, CONN_TYPE_TO_STRING(conn->type), conn->state, conn->outbuf_flushlen, conn->marked_for_close_file, conn->marked_for_close); if(connection_speaks_cells(conn)) { if(conn->state == OR_CONN_STATE_OPEN) { @@ -654,7 +656,7 @@ static void dumpstats(int severity) { for(i=0;i<nfds;i++) { conn = connection_array[i]; log(severity, "Conn %d (socket %d) type %d (%s), state %d (%s), created %ld secs ago", - i, conn->s, conn->type, conn_type_to_string[conn->type], + i, conn->s, conn->type, CONN_TYPE_TO_STRING(conn->type), conn->state, conn_state_to_string[conn->type][conn->state], now - conn->timestamp_created); if(!connection_is_listener(conn)) { log(severity,"Conn %d is to '%s:%d'.",i,conn->address, conn->port); |