diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-12-07 14:12:17 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-12-07 14:12:17 -0500 |
commit | 3fa9151f2610fdad23df02b2b914881286b22480 (patch) | |
tree | ef9f91dfb3c886a59cc591739dc7ddb6f8a703a5 /src/or | |
parent | cd4f56a37c3513cdca3463c3638067380af29219 (diff) | |
parent | 4458fd0cd8fa259f0ee8195e1aa86d5b7c6f8919 (diff) | |
download | tor-3fa9151f2610fdad23df02b2b914881286b22480.tar.gz tor-3fa9151f2610fdad23df02b2b914881286b22480.zip |
Merge branch 'win64-7260'
Conflicts:
src/or/dns.c
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/connection.c | 2 | ||||
-rw-r--r-- | src/or/connection_edge.c | 14 | ||||
-rw-r--r-- | src/or/connection_or.c | 20 | ||||
-rw-r--r-- | src/or/control.c | 3 | ||||
-rw-r--r-- | src/or/cpuworker.c | 2 | ||||
-rw-r--r-- | src/or/dns.c | 15 | ||||
-rw-r--r-- | src/or/main.c | 2 | ||||
-rw-r--r-- | src/or/relay.c | 6 |
8 files changed, 38 insertions, 26 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index dbcfc41d2b..223bbd938f 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1514,7 +1514,7 @@ connection_connect(connection_t *conn, const char *address, /* it succeeded. we're connected. */ log_fn(inprogress?LOG_DEBUG:LOG_INFO, LD_NET, - "Connection to %s:%u %s (sock %d).", + "Connection to %s:%u %s (sock "TOR_SOCKET_T_FORMAT").", escaped_safe_str_client(address), port, inprogress?"in progress":"established", s); conn->s = s; diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 67e382bdb6..3f33665e11 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -124,7 +124,8 @@ connection_edge_reached_eof(edge_connection_t *conn) /* it still has stuff to process. don't let it die yet. */ return 0; } - log_info(LD_EDGE,"conn (fd %d) reached eof. Closing.", conn->base_.s); + log_info(LD_EDGE,"conn (fd "TOR_SOCKET_T_FORMAT") reached eof. Closing.", + conn->base_.s); if (!conn->base_.marked_for_close) { /* only mark it if not already marked. it's possible to * get the 'end' right around when the client hangs up on us. */ @@ -313,11 +314,12 @@ connection_edge_end(edge_connection_t *conn, uint8_t reason) } if (circ && !circ->marked_for_close) { - log_debug(LD_EDGE,"Sending end on conn (fd %d).",conn->base_.s); + log_debug(LD_EDGE,"Sending end on conn (fd "TOR_SOCKET_T_FORMAT").", + conn->base_.s); connection_edge_send_command(conn, RELAY_COMMAND_END, payload, payload_len); } else { - log_debug(LD_EDGE,"No circ to send end on conn (fd %d).", + log_debug(LD_EDGE,"No circ to send end on conn (fd "TOR_SOCKET_T_FORMAT").", conn->base_.s); } @@ -1810,7 +1812,8 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn) edge_conn->package_window = STREAMWINDOW_START; edge_conn->deliver_window = STREAMWINDOW_START; base_conn->state = AP_CONN_STATE_CONNECT_WAIT; - log_info(LD_APP,"Address/port sent, ap socket %d, n_circ_id %d", + log_info(LD_APP,"Address/port sent, ap socket "TOR_SOCKET_T_FORMAT + ", n_circ_id %d", base_conn->s, circ->base_.n_circ_id); control_event_stream_status(ap_conn, STREAM_EVENT_SENT_CONNECT, 0); @@ -1911,7 +1914,8 @@ connection_ap_handshake_send_resolve(entry_connection_t *ap_conn) tor_free(base_conn->address); /* Maybe already set by dnsserv. */ base_conn->address = tor_strdup("(Tor_internal)"); base_conn->state = AP_CONN_STATE_RESOLVE_WAIT; - log_info(LD_APP,"Address sent for resolve, ap socket %d, n_circ_id %d", + log_info(LD_APP,"Address sent for resolve, ap socket "TOR_SOCKET_T_FORMAT + ", n_circ_id %d", base_conn->s, circ->base_.n_circ_id); control_event_stream_status(ap_conn, STREAM_EVENT_NEW, 0); control_event_stream_status(ap_conn, STREAM_EVENT_SENT_RESOLVE, 0); diff --git a/src/or/connection_or.c b/src/or/connection_or.c index a50088d579..0a3ea7c34f 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -849,7 +849,7 @@ connection_or_group_set_badness(or_connection_t *head, int force) < now) { log_info(LD_OR, "Marking OR conn to %s:%d as too old for new circuits " - "(fd %d, %d secs old).", + "(fd "TOR_SOCKET_T_FORMAT", %d secs old).", or_conn->base_.address, or_conn->base_.port, or_conn->base_.s, (int)(now - or_conn->base_.timestamp_created)); connection_or_mark_bad_for_new_circs(or_conn); @@ -880,7 +880,7 @@ connection_or_group_set_badness(or_connection_t *head, int force) * and this one is open but not canonical. Mark it bad. */ log_info(LD_OR, "Marking OR conn to %s:%d as unsuitable for new circuits: " - "(fd %d, %d secs old). It is not canonical, and we have " + "(fd "TOR_SOCKET_T_FORMAT", %d secs old). It is not canonical, and we have " "another connection to that OR that is.", or_conn->base_.address, or_conn->base_.port, or_conn->base_.s, (int)(now - or_conn->base_.timestamp_created)); @@ -928,8 +928,9 @@ connection_or_group_set_badness(or_connection_t *head, int force) if (best->is_canonical) { log_info(LD_OR, "Marking OR conn to %s:%d as unsuitable for new circuits: " - "(fd %d, %d secs old). We have a better canonical one " - "(fd %d; %d secs old).", + "(fd "TOR_SOCKET_T_FORMAT", %d secs old). " + "We have a better canonical one " + "(fd "TOR_SOCKET_T_FORMAT"; %d secs old).", or_conn->base_.address, or_conn->base_.port, or_conn->base_.s, (int)(now - or_conn->base_.timestamp_created), best->base_.s, (int)(now - best->base_.timestamp_created)); @@ -938,8 +939,9 @@ connection_or_group_set_badness(or_connection_t *head, int force) &best->real_addr, CMP_EXACT)) { log_info(LD_OR, "Marking OR conn to %s:%d as unsuitable for new circuits: " - "(fd %d, %d secs old). We have a better one with the " - "same address (fd %d; %d secs old).", + "(fd "TOR_SOCKET_T_FORMAT", %d secs old). We have a better " + "one with the " + "same address (fd "TOR_SOCKET_T_FORMAT"; %d secs old).", or_conn->base_.address, or_conn->base_.port, or_conn->base_.s, (int)(now - or_conn->base_.timestamp_created), best->base_.s, (int)(now - best->base_.timestamp_created)); @@ -1241,7 +1243,8 @@ connection_tls_start_handshake(or_connection_t *conn, int receiving) } #endif connection_start_reading(TO_CONN(conn)); - log_debug(LD_HANDSHAKE,"starting TLS handshake on fd %d", conn->base_.s); + log_debug(LD_HANDSHAKE,"starting TLS handshake on fd "TOR_SOCKET_T_FORMAT, + conn->base_.s); note_crypto_pk_op(receiving ? TLS_HANDSHAKE_S : TLS_HANDSHAKE_C); IF_HAS_BUFFEREVENT(TO_CONN(conn), { @@ -1898,7 +1901,8 @@ connection_or_process_cells_from_inbuf(or_connection_t *conn) while (1) { log_debug(LD_OR, - "%d: starting, inbuf_datalen %d (%d pending in tls object).", + TOR_SOCKET_T_FORMAT": starting, inbuf_datalen %d " + "(%d pending in tls object).", conn->base_.s,(int)connection_get_inbuf_len(TO_CONN(conn)), tor_tls_get_pending_bytes(conn->tls)); if (connection_fetch_var_cell_from_buf(conn, &var_cell)) { diff --git a/src/or/control.c b/src/or/control.c index d935265d00..75c9af6f7b 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1221,7 +1221,8 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len, connection_mark_for_close(TO_CONN(conn)); return 0; ok: - log_info(LD_CONTROL, "Authenticated control connection (%d)", conn->base_.s); + log_info(LD_CONTROL, "Authenticated control connection ("TOR_SOCKET_T_FORMAT + ")", conn->base_.s); send_control_done(conn); conn->base_.state = CONTROL_CONN_STATE_OPEN; tor_free(password); diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 119892d710..2164e52a41 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -262,7 +262,7 @@ cpuworker_main(void *data) log_info(LD_OR, "CPU worker exiting because of error on connection to Tor " "process."); - log_info(LD_OR,"(Error on %d was %s)", + log_info(LD_OR,"(Error on "TOR_SOCKET_T_FORMAT" was %s)", fd, tor_socket_strerror(tor_socket_errno(fd))); } goto end; diff --git a/src/or/dns.c b/src/or/dns.c index 870494a937..e279fbc3ba 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -890,19 +890,19 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve, pending_connection->next = resolve->pending_connections; resolve->pending_connections = pending_connection; *made_connection_pending_out = 1; - log_debug(LD_EXIT,"Connection (fd %d) waiting for pending DNS " - "resolve of %s", exitconn->base_.s, + log_debug(LD_EXIT,"Connection (fd "TOR_SOCKET_T_FORMAT") waiting " + "for pending DNS resolve of %s", exitconn->base_.s, escaped_safe_str(exitconn->base_.address)); return 0; case CACHE_STATE_CACHED: - log_debug(LD_EXIT,"Connection (fd %d) found cachedresult for %s", + log_debug(LD_EXIT,"Connection (fd "TOR_SOCKET_T_FORMAT") found " + "cached answer for %s", exitconn->base_.s, escaped_safe_str(resolve->address)); *resolve_out = resolve; return set_exitconn_info_from_resolve(exitconn, resolve, hostname_out); - case CACHE_STATE_DONE: log_err(LD_BUG, "Found a 'DONE' dns resolve still in the cache."); tor_fragile_assert(); @@ -1114,7 +1114,7 @@ connection_dns_remove(edge_connection_t *conn) if (pend->conn == conn) { resolve->pending_connections = pend->next; tor_free(pend); - log_debug(LD_EXIT, "First connection (fd %d) no longer waiting " + log_debug(LD_EXIT, "First connection (fd "TOR_SOCKET_T_FORMAT") no longer waiting " "for resolve of %s", conn->base_.s, escaped_safe_str(conn->base_.address)); @@ -1126,7 +1126,8 @@ connection_dns_remove(edge_connection_t *conn) pend->next = victim->next; tor_free(victim); log_debug(LD_EXIT, - "Connection (fd %d) no longer waiting for resolve of %s", + "Connection (fd "TOR_SOCKET_T_FORMAT") no longer waiting " + "for resolve of %s", conn->base_.s, escaped_safe_str(conn->base_.address)); return; /* more are pending */ } @@ -1968,7 +1969,7 @@ launch_wildcard_check(int min_len, int max_len, int is_ipv6, /** Launch attempts to resolve a bunch of known-good addresses (configured in * ServerDNSTestAddresses). [Callback for a libevent timer] */ static void -launch_test_addresses(int fd, short event, void *args) +launch_test_addresses(evutil_socket_t fd, short event, void *args) { const or_options_t *options = get_options(); (void)fd; diff --git a/src/or/main.c b/src/or/main.c index 446836a194..9972e59576 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -813,7 +813,7 @@ conn_close_if_marked(int i) } #endif - log_debug(LD_NET,"Cleaning up connection (fd %d).",conn->s); + log_debug(LD_NET,"Cleaning up connection (fd "TOR_SOCKET_T_FORMAT").",conn->s); /* If the connection we are about to close was trying to connect to a proxy server and failed, the client won't be able to use that diff --git a/src/or/relay.c b/src/or/relay.c index d862e58341..7f49299e2b 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1234,7 +1234,8 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, return 0; } /* XXX add to this log_fn the exit node's nickname? */ - log_info(domain,"%d: end cell (%s) for stream %d. Removing stream.", + log_info(domain,TOR_SOCKET_T_FORMAT": end cell (%s) for stream %d. " + "Removing stream.", conn->base_.s, stream_end_reason_to_string(reason), conn->stream_id); @@ -1556,7 +1557,8 @@ connection_edge_package_raw_inbuf(edge_connection_t *conn, int package_partial, connection_fetch_from_buf(payload, length, TO_CONN(conn)); } - log_debug(domain,"(%d) Packaging %d bytes (%d waiting).", conn->base_.s, + log_debug(domain,TOR_SOCKET_T_FORMAT": Packaging %d bytes (%d waiting).", + conn->base_.s, (int)length, (int)connection_get_inbuf_len(TO_CONN(conn))); if (sending_optimistically && !sending_from_optimistic) { |