diff options
author | Roger Dingledine <arma@torproject.org> | 2005-05-03 10:04:08 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-05-03 10:04:08 +0000 |
commit | 5265bbd2b8f4a28f26eabb48a4d167b765780b26 (patch) | |
tree | 9e3ee23068a617dc137f0fa203adb8b21c8a8c30 /src/or/connection.c | |
parent | b35f7dacef6b5e4215dfba9a4088a73421fb103c (diff) | |
download | tor-5265bbd2b8f4a28f26eabb48a4d167b765780b26.tar tor-5265bbd2b8f4a28f26eabb48a4d167b765780b26.tar.gz |
first iteration of scrubbing sensitive strings from logs.
also generally clean up log messages.
svn:r4174
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 665f246b1..41a2ce38b 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -173,12 +173,12 @@ connection_unregister(connection_t *conn) { if (conn->read_event) { if (event_del(conn->read_event)) - log_fn(LOG_WARN, "Error removing read event for %d", (int)conn->s); + log_fn(LOG_WARN, "Error removing read event for %d", conn->s); tor_free(conn->read_event); } if (conn->write_event) { if (event_del(conn->write_event)) - log_fn(LOG_WARN, "Error removing write event for %d", (int)conn->s); + log_fn(LOG_WARN, "Error removing write event for %d", conn->s); tor_free(conn->write_event); } } @@ -670,7 +670,8 @@ int connection_connect(connection_t *conn, char *address, uint32_t addr, uint16_ return -1; } else if (!SOCKET_IS_POLLABLE(s)) { log_fn(LOG_WARN, - "Too many connections; can't create pollable connection to %s", address); + "Too many connections; can't create pollable connection to %s", + safe_str(address)); tor_close_socket(s); return -1; } @@ -700,13 +701,13 @@ int connection_connect(connection_t *conn, char *address, uint32_t addr, uint16_ dest_addr.sin_port = htons(port); dest_addr.sin_addr.s_addr = htonl(addr); - log_fn(LOG_DEBUG,"Connecting to %s:%u.",address,port); + log_fn(LOG_DEBUG,"Connecting to %s:%u.",safe_str(address),port); if (connect(s,(struct sockaddr *)&dest_addr,sizeof(dest_addr)) < 0) { int e = tor_socket_errno(s); if (!ERRNO_IS_CONN_EINPROGRESS(e)) { /* yuck. kill it. */ - log_fn(LOG_INFO,"Connect() to %s:%u failed: %s",address,port, + log_fn(LOG_INFO,"Connect() to %s:%u failed: %s",safe_str(address),port, tor_socket_strerror(e)); tor_close_socket(s); return -1; @@ -721,7 +722,7 @@ int connection_connect(connection_t *conn, char *address, uint32_t addr, uint16_ } /* it succeeded. we're connected. */ - log_fn(LOG_INFO,"Connection to %s:%u established.",address,port); + log_fn(LOG_INFO,"Connection to %s:%u established.",safe_str(address),port); conn->s = s; if (connection_add(conn) < 0) /* no space, forget it */ return -1; |