Merge remote-tracking branch 'origin/maint-0.2.4'

This commit is contained in:
Nick Mathewson 2013-03-10 19:53:31 -04:00
commit 4235425fce
12 changed files with 154 additions and 145 deletions

View File

@ -2607,17 +2607,17 @@ channel_send_destroy(circid_t circ_id, channel_t *chan, int reason)
cell.command = CELL_DESTROY; cell.command = CELL_DESTROY;
cell.payload[0] = (uint8_t) reason; cell.payload[0] = (uint8_t) reason;
log_debug(LD_OR, log_debug(LD_OR,
"Sending destroy (circID %d) on channel %p " "Sending destroy (circID %u) on channel %p "
"(global ID " U64_FORMAT ")", "(global ID " U64_FORMAT ")",
circ_id, chan, (unsigned)circ_id, chan,
U64_PRINTF_ARG(chan->global_identifier)); U64_PRINTF_ARG(chan->global_identifier));
channel_write_cell(chan, &cell); channel_write_cell(chan, &cell);
} else { } else {
log_warn(LD_BUG, log_warn(LD_BUG,
"Someone called channel_send_destroy() for circID %d " "Someone called channel_send_destroy() for circID %u "
"on a channel " U64_FORMAT " at %p in state %s (%d)", "on a channel " U64_FORMAT " at %p in state %s (%d)",
circ_id, U64_PRINTF_ARG(chan->global_identifier), (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier),
chan, channel_state_to_string(chan->state), chan, channel_state_to_string(chan->state),
chan->state); chan->state);
} }

View File

@ -523,7 +523,7 @@ circuit_deliver_create_cell(circuit_t *circ, const create_cell_t *create_cell,
log_warn(LD_CIRC,"failed to get unique circID."); log_warn(LD_CIRC,"failed to get unique circID.");
return -1; return -1;
} }
log_debug(LD_CIRC,"Chosen circID %u.", id); log_debug(LD_CIRC,"Chosen circID %u.", (unsigned)id);
circuit_set_n_circid_chan(circ, id, circ->n_chan); circuit_set_n_circid_chan(circ, id, circ->n_chan);
memset(&cell, 0, sizeof(cell_t)); memset(&cell, 0, sizeof(cell_t));

View File

@ -780,13 +780,13 @@ circuit_dump_conn_details(int severity,
circuit_t *circ, circuit_t *circ,
int conn_array_index, int conn_array_index,
const char *type, const char *type,
int this_circid, circid_t this_circid,
int other_circid) circid_t other_circid)
{ {
tor_log(severity, LD_CIRC, "Conn %d has %s circuit: circID %d " tor_log(severity, LD_CIRC, "Conn %d has %s circuit: circID %u "
"(other side %d), state %d (%s), born %ld:", "(other side %u), state %d (%s), born %ld:",
conn_array_index, type, this_circid, other_circid, circ->state, conn_array_index, type, (unsigned)this_circid, (unsigned)other_circid,
circuit_state_to_string(circ->state), circ->state, circuit_state_to_string(circ->state),
(long)circ->timestamp_began.tv_sec); (long)circ->timestamp_began.tv_sec);
if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */ if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */
circuit_log_path(severity, LD_CIRC, TO_ORIGIN_CIRCUIT(circ)); circuit_log_path(severity, LD_CIRC, TO_ORIGIN_CIRCUIT(circ));
@ -843,12 +843,12 @@ circuit_dump_chan_details(int severity,
circuit_t *circ, circuit_t *circ,
channel_t *chan, channel_t *chan,
const char *type, const char *type,
int this_circid, circid_t this_circid,
int other_circid) circid_t other_circid)
{ {
tor_log(severity, LD_CIRC, "Conn %p has %s circuit: circID %d " tor_log(severity, LD_CIRC, "Conn %p has %s circuit: circID %u "
"(other side %d), state %d (%s), born %ld:", "(other side %u), state %d (%s), born %ld:",
chan, type, this_circid, other_circid, circ->state, chan, type, (unsigned)this_circid, (unsigned)other_circid, circ->state,
circuit_state_to_string(circ->state), circuit_state_to_string(circ->state),
(long)circ->timestamp_began.tv_sec); (long)circ->timestamp_began.tv_sec);
if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */ if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */
@ -943,16 +943,16 @@ circuit_get_by_circid_channel_impl(circid_t circ_id, channel_t *chan)
if (found && found->circuit) { if (found && found->circuit) {
log_debug(LD_CIRC, log_debug(LD_CIRC,
"circuit_get_by_circid_channel_impl() returning circuit %p for" "circuit_get_by_circid_channel_impl() returning circuit %p for"
" circ_id %d, channel ID " U64_FORMAT " (%p)", " circ_id %u, channel ID " U64_FORMAT " (%p)",
found->circuit, circ_id, found->circuit, (unsigned)circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan); U64_PRINTF_ARG(chan->global_identifier), chan);
return found->circuit; return found->circuit;
} }
log_debug(LD_CIRC, log_debug(LD_CIRC,
"circuit_get_by_circid_channel_impl() found nothing for" "circuit_get_by_circid_channel_impl() found nothing for"
" circ_id %d, channel ID " U64_FORMAT " (%p)", " circ_id %u, channel ID " U64_FORMAT " (%p)",
circ_id, (unsigned)circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan); U64_PRINTF_ARG(chan->global_identifier), chan);
return NULL; return NULL;

View File

@ -425,9 +425,9 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
} else { } else {
/* Complain and move on */ /* Complain and move on */
log_warn(LD_CIRC, log_warn(LD_CIRC,
"Circuit %d/channel " U64_FORMAT " had direction == " "Circuit %u/channel " U64_FORMAT " had direction == "
"CELL_DIRECTION_IN, but isn't an or_circuit_t", "CELL_DIRECTION_IN, but isn't an or_circuit_t",
to_remove->circ_id, (unsigned)to_remove->circ_id,
U64_PRINTF_ARG(to_remove->chan_id)); U64_PRINTF_ARG(to_remove->chan_id));
} }
@ -449,16 +449,16 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
} else { } else {
/* Complain and move on */ /* Complain and move on */
log_warn(LD_CIRC, log_warn(LD_CIRC,
"Couldn't find circuit %d (for channel " U64_FORMAT ")", "Couldn't find circuit %u (for channel " U64_FORMAT ")",
to_remove->circ_id, (unsigned)to_remove->circ_id,
U64_PRINTF_ARG(to_remove->chan_id)); U64_PRINTF_ARG(to_remove->chan_id));
} }
} else { } else {
/* Complain and move on */ /* Complain and move on */
log_warn(LD_CIRC, log_warn(LD_CIRC,
"Couldn't find channel " U64_FORMAT " (for circuit id %d)", "Couldn't find channel " U64_FORMAT " (for circuit id %u)",
U64_PRINTF_ARG(to_remove->chan_id), U64_PRINTF_ARG(to_remove->chan_id),
to_remove->circ_id); (unsigned)to_remove->circ_id);
} }
/* Assert that we don't have un-freed policy data for this circuit */ /* Assert that we don't have un-freed policy data for this circuit */
@ -905,7 +905,7 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t *circ,
log_info(LD_CIRC, log_info(LD_CIRC,
"Circuit %u on channel " U64_FORMAT " was already attached to " "Circuit %u on channel " U64_FORMAT " was already attached to "
"cmux %p (trying to attach to %p)", "cmux %p (trying to attach to %p)",
circ_id, U64_PRINTF_ARG(channel_id), (unsigned)circ_id, U64_PRINTF_ARG(channel_id),
((direction == CELL_DIRECTION_OUT) ? ((direction == CELL_DIRECTION_OUT) ?
circ->n_mux : TO_OR_CIRCUIT(circ)->p_mux), circ->n_mux : TO_OR_CIRCUIT(circ)->p_mux),
cmux); cmux);
@ -938,7 +938,7 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t *circ,
*/ */
log_debug(LD_CIRC, log_debug(LD_CIRC,
"Attaching circuit %u on channel " U64_FORMAT " to cmux %p", "Attaching circuit %u on channel " U64_FORMAT " to cmux %p",
circ_id, U64_PRINTF_ARG(channel_id), cmux); (unsigned)circ_id, U64_PRINTF_ARG(channel_id), cmux);
/* /*
* Assert that the circuit doesn't already have a mux for this * Assert that the circuit doesn't already have a mux for this
@ -1138,8 +1138,8 @@ circuitmux_make_circuit_active(circuitmux_t *cmux, circuit_t *circ,
/* If we're already active, log a warning and finish */ /* If we're already active, log a warning and finish */
if (already_active) { if (already_active) {
log_warn(LD_CIRC, log_warn(LD_CIRC,
"Circuit %d on channel " U64_FORMAT " was already active", "Circuit %u on channel " U64_FORMAT " was already active",
circ_id, U64_PRINTF_ARG(chan->global_identifier)); (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier));
return; return;
} }
@ -1236,7 +1236,7 @@ circuitmux_make_circuit_inactive(circuitmux_t *cmux, circuit_t *circ,
if (already_inactive) { if (already_inactive) {
log_warn(LD_CIRC, log_warn(LD_CIRC,
"Circuit %d on channel " U64_FORMAT " was already inactive", "Circuit %d on channel " U64_FORMAT " was already inactive",
circ_id, U64_PRINTF_ARG(chan->global_identifier)); (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier));
return; return;
} }

View File

@ -695,9 +695,9 @@ circuit_expire_building(void)
case CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT: case CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT:
case CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED: case CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED:
/* If we have reached this line, we want to spare the circ for now. */ /* If we have reached this line, we want to spare the circ for now. */
log_info(LD_CIRC,"Marking circ %d (state %d:%s, purpose %d) " log_info(LD_CIRC,"Marking circ %u (state %d:%s, purpose %d) "
"as timed-out HS circ", "as timed-out HS circ",
victim->n_circ_id, (unsigned)victim->n_circ_id,
victim->state, circuit_state_to_string(victim->state), victim->state, circuit_state_to_string(victim->state),
victim->purpose); victim->purpose);
TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1; TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1;
@ -713,9 +713,9 @@ circuit_expire_building(void)
if (!(options->CloseHSServiceRendCircuitsImmediatelyOnTimeout) && if (!(options->CloseHSServiceRendCircuitsImmediatelyOnTimeout) &&
!(TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out) && !(TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out) &&
victim->purpose == CIRCUIT_PURPOSE_S_CONNECT_REND) { victim->purpose == CIRCUIT_PURPOSE_S_CONNECT_REND) {
log_info(LD_CIRC,"Marking circ %d (state %d:%s, purpose %d) " log_info(LD_CIRC,"Marking circ %u (state %d:%s, purpose %d) "
"as timed-out HS circ; relaunching rendezvous attempt.", "as timed-out HS circ; relaunching rendezvous attempt.",
victim->n_circ_id, (unsigned)victim->n_circ_id,
victim->state, circuit_state_to_string(victim->state), victim->state, circuit_state_to_string(victim->state),
victim->purpose); victim->purpose);
TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1; TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1;
@ -728,7 +728,7 @@ circuit_expire_building(void)
"Abandoning circ %u %s:%d (state %d,%d:%s, purpose %d, " "Abandoning circ %u %s:%d (state %d,%d:%s, purpose %d, "
"len %d)", TO_ORIGIN_CIRCUIT(victim)->global_identifier, "len %d)", TO_ORIGIN_CIRCUIT(victim)->global_identifier,
channel_get_canonical_remote_descr(victim->n_chan), channel_get_canonical_remote_descr(victim->n_chan),
victim->n_circ_id, (unsigned)victim->n_circ_id,
TO_ORIGIN_CIRCUIT(victim)->has_opened, TO_ORIGIN_CIRCUIT(victim)->has_opened,
victim->state, circuit_state_to_string(victim->state), victim->state, circuit_state_to_string(victim->state),
victim->purpose, victim->purpose,
@ -737,7 +737,8 @@ circuit_expire_building(void)
log_info(LD_CIRC, log_info(LD_CIRC,
"Abandoning circ %u %d (state %d,%d:%s, purpose %d, len %d)", "Abandoning circ %u %d (state %d,%d:%s, purpose %d, len %d)",
TO_ORIGIN_CIRCUIT(victim)->global_identifier, TO_ORIGIN_CIRCUIT(victim)->global_identifier,
victim->n_circ_id, TO_ORIGIN_CIRCUIT(victim)->has_opened, (unsigned)victim->n_circ_id,
TO_ORIGIN_CIRCUIT(victim)->has_opened,
victim->state, victim->state,
circuit_state_to_string(victim->state), victim->purpose, circuit_state_to_string(victim->state), victim->purpose,
TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len); TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len);
@ -1070,9 +1071,10 @@ circuit_expire_old_circuits_clientside(void)
circ->timestamp_dirty + get_options()->MaxCircuitDirtiness < circ->timestamp_dirty + get_options()->MaxCircuitDirtiness <
now.tv_sec && now.tv_sec &&
!TO_ORIGIN_CIRCUIT(circ)->p_streams /* nothing attached */ ) { !TO_ORIGIN_CIRCUIT(circ)->p_streams /* nothing attached */ ) {
log_debug(LD_CIRC, "Closing n_circ_id %d (dirty %ld sec ago, " log_debug(LD_CIRC, "Closing n_circ_id %u (dirty %ld sec ago, "
"purpose %d)", "purpose %d)",
circ->n_circ_id, (long)(now.tv_sec - circ->timestamp_dirty), (unsigned)circ->n_circ_id,
(long)(now.tv_sec - circ->timestamp_dirty),
circ->purpose); circ->purpose);
/* Don't do this magic for testing circuits. Their death is governed /* Don't do this magic for testing circuits. Their death is governed
* by circuit_expire_building */ * by circuit_expire_building */
@ -1153,8 +1155,8 @@ circuit_expire_old_circuits_serverside(time_t now)
!or_circ->n_streams && !or_circ->resolving_streams && !or_circ->n_streams && !or_circ->resolving_streams &&
or_circ->p_chan && or_circ->p_chan &&
channel_when_last_xmit(or_circ->p_chan) <= cutoff) { channel_when_last_xmit(or_circ->p_chan) <= cutoff) {
log_info(LD_CIRC, "Closing circ_id %d (empty %d secs ago)", log_info(LD_CIRC, "Closing circ_id %u (empty %d secs ago)",
or_circ->p_circ_id, (unsigned)or_circ->p_circ_id,
(int)(now - channel_when_last_xmit(or_circ->p_chan))); (int)(now - channel_when_last_xmit(or_circ->p_chan)));
circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED); circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED);
} }
@ -1896,8 +1898,8 @@ link_apconn_to_circ(entry_connection_t *apconn, origin_circuit_t *circ,
const node_t *exitnode; const node_t *exitnode;
/* add it into the linked list of streams on this circuit */ /* add it into the linked list of streams on this circuit */
log_debug(LD_APP|LD_CIRC, "attaching new conn to circ. n_circ_id %d.", log_debug(LD_APP|LD_CIRC, "attaching new conn to circ. n_circ_id %u.",
circ->base_.n_circ_id); (unsigned)circ->base_.n_circ_id);
/* reset it, so we can measure circ timeouts */ /* reset it, so we can measure circ timeouts */
ENTRY_TO_CONN(apconn)->timestamp_lastread = time(NULL); ENTRY_TO_CONN(apconn)->timestamp_lastread = time(NULL);
ENTRY_TO_EDGE_CONN(apconn)->next_stream = circ->p_streams; ENTRY_TO_EDGE_CONN(apconn)->next_stream = circ->p_streams;
@ -2121,8 +2123,8 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
return retval; return retval;
log_debug(LD_APP|LD_CIRC, log_debug(LD_APP|LD_CIRC,
"Attaching apconn to circ %d (stream %d sec old).", "Attaching apconn to circ %u (stream %d sec old).",
circ->base_.n_circ_id, conn_age); (unsigned)circ->base_.n_circ_id, conn_age);
/* print the circ's path, so people can figure out which circs are /* print the circ's path, so people can figure out which circs are
* sucking. */ * sucking. */
circuit_log_path(LOG_INFO,LD_APP|LD_CIRC,circ); circuit_log_path(LOG_INFO,LD_APP|LD_CIRC,circ);
@ -2147,7 +2149,7 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
log_info(LD_REND, log_info(LD_REND,
"rend joined circ %d already here. attaching. " "rend joined circ %d already here. attaching. "
"(stream %d sec old)", "(stream %d sec old)",
rendcirc->base_.n_circ_id, conn_age); (unsigned)rendcirc->base_.n_circ_id, conn_age);
/* Mark rendezvous circuits as 'newly dirty' every time you use /* Mark rendezvous circuits as 'newly dirty' every time you use
* them, since the process of rebuilding a rendezvous circ is so * them, since the process of rebuilding a rendezvous circ is so
* expensive. There is a tradeoff between linkability and * expensive. There is a tradeoff between linkability and
@ -2168,9 +2170,9 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (rendcirc && (rendcirc->base_.purpose == if (rendcirc && (rendcirc->base_.purpose ==
CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED)) { CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED)) {
log_info(LD_REND, log_info(LD_REND,
"pending-join circ %d already here, with intro ack. " "pending-join circ %u already here, with intro ack. "
"Stalling. (stream %d sec old)", "Stalling. (stream %d sec old)",
rendcirc->base_.n_circ_id, conn_age); (unsigned)rendcirc->base_.n_circ_id, conn_age);
return 0; return 0;
} }
@ -2182,10 +2184,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (retval > 0) { if (retval > 0) {
/* one has already sent the intro. keep waiting. */ /* one has already sent the intro. keep waiting. */
tor_assert(introcirc); tor_assert(introcirc);
log_info(LD_REND, "Intro circ %d present and awaiting ack (rend %d). " log_info(LD_REND, "Intro circ %u present and awaiting ack (rend %u). "
"Stalling. (stream %d sec old)", "Stalling. (stream %d sec old)",
introcirc->base_.n_circ_id, (unsigned)introcirc->base_.n_circ_id,
rendcirc ? rendcirc->base_.n_circ_id : 0, rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0,
conn_age); conn_age);
return 0; return 0;
} }
@ -2195,16 +2197,17 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (rendcirc && introcirc && if (rendcirc && introcirc &&
rendcirc->base_.purpose == CIRCUIT_PURPOSE_C_REND_READY) { rendcirc->base_.purpose == CIRCUIT_PURPOSE_C_REND_READY) {
log_info(LD_REND, log_info(LD_REND,
"ready rend circ %d already here (no intro-ack yet on " "ready rend circ %u already here (no intro-ack yet on "
"intro %d). (stream %d sec old)", "intro %u). (stream %d sec old)",
rendcirc->base_.n_circ_id, (unsigned)rendcirc->base_.n_circ_id,
introcirc->base_.n_circ_id, conn_age); (unsigned)introcirc->base_.n_circ_id, conn_age);
tor_assert(introcirc->base_.purpose == CIRCUIT_PURPOSE_C_INTRODUCING); tor_assert(introcirc->base_.purpose == CIRCUIT_PURPOSE_C_INTRODUCING);
if (introcirc->base_.state == CIRCUIT_STATE_OPEN) { if (introcirc->base_.state == CIRCUIT_STATE_OPEN) {
log_info(LD_REND,"found open intro circ %d (rend %d); sending " log_info(LD_REND,"found open intro circ %u (rend %u); sending "
"introduction. (stream %d sec old)", "introduction. (stream %d sec old)",
introcirc->base_.n_circ_id, rendcirc->base_.n_circ_id, (unsigned)introcirc->base_.n_circ_id,
(unsigned)rendcirc->base_.n_circ_id,
conn_age); conn_age);
switch (rend_client_send_introduction(introcirc, rendcirc)) { switch (rend_client_send_introduction(introcirc, rendcirc)) {
case 0: /* success */ case 0: /* success */
@ -2228,10 +2231,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
} }
} }
log_info(LD_REND, "Intro (%d) and rend (%d) circs are not both ready. " log_info(LD_REND, "Intro (%u) and rend (%u) circs are not both ready. "
"Stalling conn. (%d sec old)", "Stalling conn. (%d sec old)",
introcirc ? introcirc->base_.n_circ_id : 0, introcirc ? (unsigned)introcirc->base_.n_circ_id : 0,
rendcirc ? rendcirc->base_.n_circ_id : 0, conn_age); rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0, conn_age);
return 0; return 0;
} }
} }

View File

@ -16,7 +16,6 @@
* callbacks registered in command_setup_channel(), * callbacks registered in command_setup_channel(),
* called when channels are created in circuitbuild.c * called when channels are created in circuitbuild.c
*/ */
#include "or.h" #include "or.h"
#include "channel.h" #include "channel.h"
#include "circuitbuild.h" #include "circuitbuild.h"
@ -195,9 +194,9 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
tor_assert(chan); tor_assert(chan);
log_debug(LD_OR, log_debug(LD_OR,
"Got a CREATE cell for circ_id %d on channel " U64_FORMAT "Got a CREATE cell for circ_id %u on channel " U64_FORMAT
" (%p)", " (%p)",
cell->circ_id, (unsigned)cell->circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan); U64_PRINTF_ARG(chan->global_identifier), chan);
if (we_are_hibernating()) { if (we_are_hibernating()) {
@ -240,8 +239,8 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
(!id_is_high && (!id_is_high &&
chan->circ_id_type == CIRC_ID_TYPE_LOWER)) { chan->circ_id_type == CIRC_ID_TYPE_LOWER)) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
"Received create cell with unexpected circ_id %d. Closing.", "Received create cell with unexpected circ_id %u. Closing.",
cell->circ_id); (unsigned)cell->circ_id);
channel_send_destroy(cell->circ_id, chan, channel_send_destroy(cell->circ_id, chan,
END_CIRC_REASON_TORPROTOCOL); END_CIRC_REASON_TORPROTOCOL);
return; return;
@ -250,9 +249,10 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
if (circuit_id_in_use_on_channel(cell->circ_id, chan)) { if (circuit_id_in_use_on_channel(cell->circ_id, chan)) {
const node_t *node = node_get_by_id(chan->identity_digest); const node_t *node = node_get_by_id(chan->identity_digest);
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
"Received CREATE cell (circID %d) for known circ. " "Received CREATE cell (circID %u) for known circ. "
"Dropping (age %d).", "Dropping (age %d).",
cell->circ_id, (int)(time(NULL) - channel_when_created(chan))); (unsigned)cell->circ_id,
(int)(time(NULL) - channel_when_created(chan)));
if (node) { if (node) {
char *p = esc_for_log(node_get_platform(node)); char *p = esc_for_log(node_get_platform(node));
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
@ -341,8 +341,8 @@ command_process_created_cell(cell_t *cell, channel_t *chan)
if (!circ) { if (!circ) {
log_info(LD_OR, log_info(LD_OR,
"(circID %d) unknown circ (probably got a destroy earlier). " "(circID %u) unknown circ (probably got a destroy earlier). "
"Dropping.", cell->circ_id); "Dropping.", (unsigned)cell->circ_id);
return; return;
} }
@ -412,8 +412,9 @@ command_process_relay_cell(cell_t *cell, channel_t *chan)
if (!circ) { if (!circ) {
log_debug(LD_OR, log_debug(LD_OR,
"unknown circuit %d on connection from %s. Dropping.", "unknown circuit %u on connection from %s. Dropping.",
cell->circ_id, channel_get_canonical_remote_descr(chan)); (unsigned)cell->circ_id,
channel_get_canonical_remote_descr(chan));
return; return;
} }
@ -447,9 +448,9 @@ command_process_relay_cell(cell_t *cell, channel_t *chan)
or_circuit_t *or_circ = TO_OR_CIRCUIT(circ); or_circuit_t *or_circ = TO_OR_CIRCUIT(circ);
if (or_circ->remaining_relay_early_cells == 0) { if (or_circ->remaining_relay_early_cells == 0) {
log_fn(LOG_PROTOCOL_WARN, LD_OR, log_fn(LOG_PROTOCOL_WARN, LD_OR,
"Received too many RELAY_EARLY cells on circ %d from %s." "Received too many RELAY_EARLY cells on circ %u from %s."
" Closing circuit.", " Closing circuit.",
cell->circ_id, (unsigned)cell->circ_id,
safe_str(channel_get_canonical_remote_descr(chan))); safe_str(channel_get_canonical_remote_descr(chan)));
circuit_mark_for_close(circ, END_CIRC_REASON_TORPROTOCOL); circuit_mark_for_close(circ, END_CIRC_REASON_TORPROTOCOL);
return; return;
@ -487,11 +488,12 @@ command_process_destroy_cell(cell_t *cell, channel_t *chan)
circ = circuit_get_by_circid_channel(cell->circ_id, chan); circ = circuit_get_by_circid_channel(cell->circ_id, chan);
if (!circ) { if (!circ) {
log_info(LD_OR,"unknown circuit %d on connection from %s. Dropping.", log_info(LD_OR,"unknown circuit %u on connection from %s. Dropping.",
cell->circ_id, channel_get_canonical_remote_descr(chan)); (unsigned)cell->circ_id,
channel_get_canonical_remote_descr(chan));
return; return;
} }
log_debug(LD_OR,"Received for circID %d.",cell->circ_id); log_debug(LD_OR,"Received for circID %u.",(unsigned)cell->circ_id);
reason = (uint8_t)cell->payload[0]; reason = (uint8_t)cell->payload[0];

View File

@ -218,8 +218,8 @@ int
connection_edge_destroy(circid_t circ_id, edge_connection_t *conn) connection_edge_destroy(circid_t circ_id, edge_connection_t *conn)
{ {
if (!conn->base_.marked_for_close) { if (!conn->base_.marked_for_close) {
log_info(LD_EDGE, log_info(LD_EDGE, "CircID %u: At an edge. Marking connection for close.",
"CircID %d: At an edge. Marking connection for close.", circ_id); (unsigned) circ_id);
if (conn->base_.type == CONN_TYPE_AP) { if (conn->base_.type == CONN_TYPE_AP) {
entry_connection_t *entry_conn = EDGE_TO_ENTRY_CONN(conn); entry_connection_t *entry_conn = EDGE_TO_ENTRY_CONN(conn);
connection_mark_unattached_ap(entry_conn, END_STREAM_REASON_DESTROY); connection_mark_unattached_ap(entry_conn, END_STREAM_REASON_DESTROY);
@ -1847,8 +1847,8 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn)
edge_conn->deliver_window = STREAMWINDOW_START; edge_conn->deliver_window = STREAMWINDOW_START;
base_conn->state = AP_CONN_STATE_CONNECT_WAIT; base_conn->state = AP_CONN_STATE_CONNECT_WAIT;
log_info(LD_APP,"Address/port sent, ap socket "TOR_SOCKET_T_FORMAT log_info(LD_APP,"Address/port sent, ap socket "TOR_SOCKET_T_FORMAT
", n_circ_id %d", ", n_circ_id %u",
base_conn->s, circ->base_.n_circ_id); base_conn->s, (unsigned)circ->base_.n_circ_id);
control_event_stream_status(ap_conn, STREAM_EVENT_SENT_CONNECT, 0); control_event_stream_status(ap_conn, STREAM_EVENT_SENT_CONNECT, 0);
/* If there's queued-up data, send it now */ /* If there's queued-up data, send it now */
@ -1949,8 +1949,8 @@ connection_ap_handshake_send_resolve(entry_connection_t *ap_conn)
base_conn->address = tor_strdup("(Tor_internal)"); base_conn->address = tor_strdup("(Tor_internal)");
base_conn->state = AP_CONN_STATE_RESOLVE_WAIT; base_conn->state = AP_CONN_STATE_RESOLVE_WAIT;
log_info(LD_APP,"Address sent for resolve, ap socket "TOR_SOCKET_T_FORMAT log_info(LD_APP,"Address sent for resolve, ap socket "TOR_SOCKET_T_FORMAT
", n_circ_id %d", ", n_circ_id %u",
base_conn->s, circ->base_.n_circ_id); base_conn->s, (unsigned)circ->base_.n_circ_id);
control_event_stream_status(ap_conn, STREAM_EVENT_NEW, 0); control_event_stream_status(ap_conn, STREAM_EVENT_NEW, 0);
control_event_stream_status(ap_conn, STREAM_EVENT_SENT_RESOLVE, 0); control_event_stream_status(ap_conn, STREAM_EVENT_SENT_RESOLVE, 0);
return 0; return 0;

View File

@ -9,7 +9,6 @@
* \brief Functions to handle OR connections, TLS handshaking, and * \brief Functions to handle OR connections, TLS handshaking, and
* cells on the network. * cells on the network.
**/ **/
#include "or.h" #include "or.h"
#include "buffers.h" #include "buffers.h"
/* /*

View File

@ -11,7 +11,6 @@
* *
* Right now, we only use this for processing onionskins. * Right now, we only use this for processing onionskins.
**/ **/
#include "or.h" #include "or.h"
#include "buffers.h" #include "buffers.h"
#include "channel.h" #include "channel.h"
@ -341,8 +340,8 @@ connection_cpu_process_inbuf(connection_t *conn)
circ = NULL; circ = NULL;
log_debug(LD_OR, log_debug(LD_OR,
"Unpacking cpuworker reply, chan_id is " U64_FORMAT "Unpacking cpuworker reply, chan_id is " U64_FORMAT
", circ_id is %d", ", circ_id is %u",
U64_PRINTF_ARG(chan_id), circ_id); U64_PRINTF_ARG(chan_id), (unsigned)circ_id);
p_chan = channel_find_by_global_id(chan_id); p_chan = channel_find_by_global_id(chan_id);
if (p_chan) if (p_chan)

View File

@ -111,14 +111,14 @@ rend_client_reextend_intro_circuit(origin_circuit_t *circ)
// XXX: should we not re-extend if hs_circ_has_timed_out? // XXX: should we not re-extend if hs_circ_has_timed_out?
if (circ->remaining_relay_early_cells) { if (circ->remaining_relay_early_cells) {
log_info(LD_REND, log_info(LD_REND,
"Re-extending circ %d, this time to %s.", "Re-extending circ %u, this time to %s.",
circ->base_.n_circ_id, (unsigned)circ->base_.n_circ_id,
safe_str_client(extend_info_describe(extend_info))); safe_str_client(extend_info_describe(extend_info)));
result = circuit_extend_to_new_exit(circ, extend_info); result = circuit_extend_to_new_exit(circ, extend_info);
} else { } else {
log_info(LD_REND, log_info(LD_REND,
"Closing intro circ %d (out of RELAY_EARLY cells).", "Closing intro circ %u (out of RELAY_EARLY cells).",
circ->base_.n_circ_id); (unsigned)circ->base_.n_circ_id);
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_FINISHED); circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_FINISHED);
/* connection_ap_handshake_attach_circuit will launch a new intro circ. */ /* connection_ap_handshake_attach_circuit will launch a new intro circ. */
result = 0; result = 0;
@ -386,8 +386,8 @@ rend_client_introduction_acked(origin_circuit_t *circ,
if (circ->base_.purpose != CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) { if (circ->base_.purpose != CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) {
log_warn(LD_PROTOCOL, log_warn(LD_PROTOCOL,
"Received REND_INTRODUCE_ACK on unexpected circuit %d.", "Received REND_INTRODUCE_ACK on unexpected circuit %u.",
circ->base_.n_circ_id); (unsigned)circ->base_.n_circ_id);
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL); circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL);
return -1; return -1;
} }

View File

@ -32,8 +32,8 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request,
int reason = END_CIRC_REASON_INTERNAL; int reason = END_CIRC_REASON_INTERNAL;
log_info(LD_REND, log_info(LD_REND,
"Received an ESTABLISH_INTRO request on circuit %d", "Received an ESTABLISH_INTRO request on circuit %u",
circ->p_circ_id); (unsigned) circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) { if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
@ -114,8 +114,8 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request,
memcpy(circ->rend_token, pk_digest, DIGEST_LEN); memcpy(circ->rend_token, pk_digest, DIGEST_LEN);
log_info(LD_REND, log_info(LD_REND,
"Established introduction point on circuit %d for service %s", "Established introduction point on circuit %u for service %s",
circ->p_circ_id, safe_str(serviceid)); (unsigned) circ->p_circ_id, safe_str(serviceid));
return 0; return 0;
truncated: truncated:
@ -139,13 +139,13 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
char serviceid[REND_SERVICE_ID_LEN_BASE32+1]; char serviceid[REND_SERVICE_ID_LEN_BASE32+1];
char nak_body[1]; char nak_body[1];
log_info(LD_REND, "Received an INTRODUCE1 request on circuit %d", log_info(LD_REND, "Received an INTRODUCE1 request on circuit %u",
circ->p_circ_id); (unsigned)circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) { if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_warn(LD_PROTOCOL, log_warn(LD_PROTOCOL,
"Rejecting INTRODUCE1 on non-OR or non-edge circuit %d.", "Rejecting INTRODUCE1 on non-OR or non-edge circuit %u.",
circ->p_circ_id); (unsigned)circ->p_circ_id);
goto err; goto err;
} }
@ -155,9 +155,9 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
*/ */
if (request_len < (DIGEST_LEN+(MAX_NICKNAME_LEN+1)+REND_COOKIE_LEN+ if (request_len < (DIGEST_LEN+(MAX_NICKNAME_LEN+1)+REND_COOKIE_LEN+
DH_KEY_LEN+CIPHER_KEY_LEN+PKCS1_OAEP_PADDING_OVERHEAD)) { DH_KEY_LEN+CIPHER_KEY_LEN+PKCS1_OAEP_PADDING_OVERHEAD)) {
log_warn(LD_PROTOCOL, "Impossibly short INTRODUCE1 cell on circuit %d; " log_warn(LD_PROTOCOL, "Impossibly short INTRODUCE1 cell on circuit %u; "
"responding with nack.", "responding with nack.",
circ->p_circ_id); (unsigned)circ->p_circ_id);
goto err; goto err;
} }
@ -168,17 +168,17 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
intro_circ = circuit_get_intro_point((char*)request); intro_circ = circuit_get_intro_point((char*)request);
if (!intro_circ) { if (!intro_circ) {
log_info(LD_REND, log_info(LD_REND,
"No intro circ found for INTRODUCE1 cell (%s) from circuit %d; " "No intro circ found for INTRODUCE1 cell (%s) from circuit %u; "
"responding with nack.", "responding with nack.",
safe_str(serviceid), circ->p_circ_id); safe_str(serviceid), (unsigned)circ->p_circ_id);
goto err; goto err;
} }
log_info(LD_REND, log_info(LD_REND,
"Sending introduction request for service %s " "Sending introduction request for service %s "
"from circ %d to circ %d", "from circ %u to circ %u",
safe_str(serviceid), circ->p_circ_id, safe_str(serviceid), (unsigned)circ->p_circ_id,
intro_circ->p_circ_id); (unsigned)intro_circ->p_circ_id);
/* Great. Now we just relay the cell down the circuit. */ /* Great. Now we just relay the cell down the circuit. */
if (relay_send_command_from_edge(0, TO_CIRCUIT(intro_circ), if (relay_send_command_from_edge(0, TO_CIRCUIT(intro_circ),
@ -221,8 +221,8 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
char hexid[9]; char hexid[9];
int reason = END_CIRC_REASON_TORPROTOCOL; int reason = END_CIRC_REASON_TORPROTOCOL;
log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %d", log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %u",
circ->p_circ_id); (unsigned)circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) { if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_warn(LD_PROTOCOL, log_warn(LD_PROTOCOL,
@ -256,8 +256,8 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
base16_encode(hexid,9,(char*)request,4); base16_encode(hexid,9,(char*)request,4);
log_info(LD_REND, log_info(LD_REND,
"Established rendezvous point on circuit %d for cookie %s", "Established rendezvous point on circuit %u for cookie %s",
circ->p_circ_id, hexid); (unsigned)circ->p_circ_id, hexid);
return 0; return 0;
err: err:
@ -279,16 +279,16 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) { if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_info(LD_REND, log_info(LD_REND,
"Tried to complete rendezvous on non-OR or non-edge circuit %d.", "Tried to complete rendezvous on non-OR or non-edge circuit %u.",
circ->p_circ_id); (unsigned)circ->p_circ_id);
reason = END_CIRC_REASON_TORPROTOCOL; reason = END_CIRC_REASON_TORPROTOCOL;
goto err; goto err;
} }
if (request_len != REND_COOKIE_LEN+DH_KEY_LEN+DIGEST_LEN) { if (request_len != REND_COOKIE_LEN+DH_KEY_LEN+DIGEST_LEN) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
"Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %d.", "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %u.",
(int)request_len, circ->p_circ_id); (int)request_len, (unsigned)circ->p_circ_id);
reason = END_CIRC_REASON_TORPROTOCOL; reason = END_CIRC_REASON_TORPROTOCOL;
goto err; goto err;
} }
@ -296,8 +296,8 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
base16_encode(hexid, sizeof(hexid), (const char*)request, 4); base16_encode(hexid, sizeof(hexid), (const char*)request, 4);
log_info(LD_REND, log_info(LD_REND,
"Got request for rendezvous from circuit %d to cookie %s.", "Got request for rendezvous from circuit %u to cookie %s.",
circ->p_circ_id, hexid); (unsigned)circ->p_circ_id, hexid);
rend_circ = circuit_get_rendezvous((char*)request); rend_circ = circuit_get_rendezvous((char*)request);
if (!rend_circ) { if (!rend_circ) {
@ -314,15 +314,15 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
(char*)(request+REND_COOKIE_LEN), (char*)(request+REND_COOKIE_LEN),
request_len-REND_COOKIE_LEN, NULL)) { request_len-REND_COOKIE_LEN, NULL)) {
log_warn(LD_GENERAL, log_warn(LD_GENERAL,
"Unable to send RENDEZVOUS2 cell to client on circuit %d.", "Unable to send RENDEZVOUS2 cell to client on circuit %u.",
rend_circ->p_circ_id); (unsigned)rend_circ->p_circ_id);
goto err; goto err;
} }
/* Join the circuits. */ /* Join the circuits. */
log_info(LD_REND, log_info(LD_REND,
"Completing rendezvous: circuit %d joins circuit %d (cookie %s)", "Completing rendezvous: circuit %u joins circuit %u (cookie %s)",
circ->p_circ_id, rend_circ->p_circ_id, hexid); (unsigned)circ->p_circ_id, (unsigned)rend_circ->p_circ_id, hexid);
circuit_change_purpose(TO_CIRCUIT(circ), CIRCUIT_PURPOSE_REND_ESTABLISHED); circuit_change_purpose(TO_CIRCUIT(circ), CIRCUIT_PURPOSE_REND_ESTABLISHED);
circuit_change_purpose(TO_CIRCUIT(rend_circ), circuit_change_purpose(TO_CIRCUIT(rend_circ),

View File

@ -1126,8 +1126,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
/* Do some initial validation and logging before we parse the cell */ /* Do some initial validation and logging before we parse the cell */
if (circuit->base_.purpose != CIRCUIT_PURPOSE_S_INTRO) { if (circuit->base_.purpose != CIRCUIT_PURPOSE_S_INTRO) {
log_warn(LD_PROTOCOL, log_warn(LD_PROTOCOL,
"Got an INTRODUCE2 over a non-introduction circuit %d.", "Got an INTRODUCE2 over a non-introduction circuit %u.",
circuit->base_.n_circ_id); (unsigned) circuit->base_.n_circ_id);
goto err; goto err;
} }
@ -1161,8 +1161,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
goto err; goto err;
} }
log_info(LD_REND, "Received INTRODUCE2 cell for service %s on circ %d.", log_info(LD_REND, "Received INTRODUCE2 cell for service %s on circ %u.",
escaped(serviceid), circuit->base_.n_circ_id); escaped(serviceid), (unsigned)circuit->base_.n_circ_id);
/* use intro key instead of service key. */ /* use intro key instead of service key. */
intro_key = circuit->intro_key; intro_key = circuit->intro_key;
@ -1177,7 +1177,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (!parsed_req) { if (!parsed_req) {
goto log_error; goto log_error;
} else if (err_msg) { } else if (err_msg) {
log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id); log_info(LD_REND, "%s on circ %u.", err_msg,
(unsigned)circuit->base_.n_circ_id);
tor_free(err_msg); tor_free(err_msg);
} }
@ -1187,7 +1188,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) { if (result < 0) {
goto log_error; goto log_error;
} else if (err_msg) { } else if (err_msg) {
log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id); log_info(LD_REND, "%s on circ %u.", err_msg,
(unsigned)circuit->base_.n_circ_id);
tor_free(err_msg); tor_free(err_msg);
} }
@ -1223,7 +1225,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) { if (result < 0) {
goto log_error; goto log_error;
} else if (err_msg) { } else if (err_msg) {
log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id); log_info(LD_REND, "%s on circ %u.", err_msg,
(unsigned)circuit->base_.n_circ_id);
tor_free(err_msg); tor_free(err_msg);
} }
@ -1233,7 +1236,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) { if (result < 0) {
goto log_error; goto log_error;
} else if (err_msg) { } else if (err_msg) {
log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id); log_info(LD_REND, "%s on circ %u.", err_msg,
(unsigned)circuit->base_.n_circ_id);
tor_free(err_msg); tor_free(err_msg);
} }
@ -1243,7 +1247,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) { if (result < 0) {
goto log_error; goto log_error;
} else if (err_msg) { } else if (err_msg) {
log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id); log_info(LD_REND, "%s on circ %u.", err_msg,
(unsigned)circuit->base_.n_circ_id);
tor_free(err_msg); tor_free(err_msg);
} }
stage_descr = NULL; stage_descr = NULL;
@ -1393,7 +1398,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
} }
} }
log_warn(LD_REND, "%s on circ %d", err_msg, circuit->base_.n_circ_id); log_warn(LD_REND, "%s on circ %u", err_msg,
(unsigned)circuit->base_.n_circ_id);
err: err:
status = -1; status = -1;
if (dh) crypto_dh_free(dh); if (dh) crypto_dh_free(dh);
@ -2417,8 +2423,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
service = rend_service_get_by_pk_digest( service = rend_service_get_by_pk_digest(
circuit->rend_data->rend_pk_digest); circuit->rend_data->rend_pk_digest);
if (!service) { if (!service) {
log_warn(LD_REND, "Unrecognized service ID %s on introduction circuit %d.", log_warn(LD_REND, "Unrecognized service ID %s on introduction circuit %u.",
serviceid, circuit->base_.n_circ_id); serviceid, (unsigned)circuit->base_.n_circ_id);
reason = END_CIRC_REASON_NOSUCHSERVICE; reason = END_CIRC_REASON_NOSUCHSERVICE;
goto err; goto err;
} }
@ -2461,8 +2467,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
} }
log_info(LD_REND, log_info(LD_REND,
"Established circuit %d as introduction point for service %s", "Established circuit %u as introduction point for service %s",
circuit->base_.n_circ_id, serviceid); (unsigned)circuit->base_.n_circ_id, serviceid);
/* Use the intro key instead of the service key in ESTABLISH_INTRO. */ /* Use the intro key instead of the service key in ESTABLISH_INTRO. */
intro_key = circuit->intro_key; intro_key = circuit->intro_key;
@ -2496,8 +2502,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
RELAY_COMMAND_ESTABLISH_INTRO, RELAY_COMMAND_ESTABLISH_INTRO,
buf, len, circuit->cpath->prev)<0) { buf, len, circuit->cpath->prev)<0) {
log_info(LD_GENERAL, log_info(LD_GENERAL,
"Couldn't send introduction request for service %s on circuit %d", "Couldn't send introduction request for service %s on circuit %u",
serviceid, circuit->base_.n_circ_id); serviceid, (unsigned)circuit->base_.n_circ_id);
reason = END_CIRC_REASON_INTERNAL; reason = END_CIRC_REASON_INTERNAL;
goto err; goto err;
} }
@ -2539,8 +2545,8 @@ rend_service_intro_established(origin_circuit_t *circuit,
service = rend_service_get_by_pk_digest( service = rend_service_get_by_pk_digest(
circuit->rend_data->rend_pk_digest); circuit->rend_data->rend_pk_digest);
if (!service) { if (!service) {
log_warn(LD_REND, "Unknown service on introduction circuit %d.", log_warn(LD_REND, "Unknown service on introduction circuit %u.",
circuit->base_.n_circ_id); (unsigned)circuit->base_.n_circ_id);
goto err; goto err;
} }
service->desc_is_dirty = time(NULL); service->desc_is_dirty = time(NULL);
@ -2549,8 +2555,8 @@ rend_service_intro_established(origin_circuit_t *circuit,
base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32 + 1, base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32 + 1,
circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN); circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN);
log_info(LD_REND, log_info(LD_REND,
"Received INTRO_ESTABLISHED cell on circuit %d for service %s", "Received INTRO_ESTABLISHED cell on circuit %u for service %s",
circuit->base_.n_circ_id, serviceid); (unsigned)circuit->base_.n_circ_id, serviceid);
/* Getting a valid INTRODUCE_ESTABLISHED means we've successfully /* Getting a valid INTRODUCE_ESTABLISHED means we've successfully
* used the circ */ * used the circ */
@ -2597,9 +2603,9 @@ rend_service_rendezvous_has_opened(origin_circuit_t *circuit)
circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN); circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN);
log_info(LD_REND, log_info(LD_REND,
"Done building circuit %d to rendezvous with " "Done building circuit %u to rendezvous with "
"cookie %s for service %s", "cookie %s for service %s",
circuit->base_.n_circ_id, hexcookie, serviceid); (unsigned)circuit->base_.n_circ_id, hexcookie, serviceid);
/* Clear the 'in-progress HS circ has timed out' flag for /* Clear the 'in-progress HS circ has timed out' flag for
* consistency with what happens on the client side; this line has * consistency with what happens on the client side; this line has
@ -3339,8 +3345,8 @@ rend_service_set_connection_addr_port(edge_connection_t *conn,
circ->rend_data->rend_pk_digest); circ->rend_data->rend_pk_digest);
if (!service) { if (!service) {
log_warn(LD_REND, "Couldn't find any service associated with pk %s on " log_warn(LD_REND, "Couldn't find any service associated with pk %s on "
"rendezvous circuit %d; closing.", "rendezvous circuit %u; closing.",
serviceid, circ->base_.n_circ_id); serviceid, (unsigned)circ->base_.n_circ_id);
return -1; return -1;
} }
matching_ports = smartlist_new(); matching_ports = smartlist_new();