cell.command = CELL_DESTROY;
cell.payload[0] = (uint8_t) reason;
log_debug(LD_OR,
- "Sending destroy (circID %d) on channel %p "
+ "Sending destroy (circID %u) on channel %p "
"(global ID " U64_FORMAT ")",
- circ_id, chan,
+ (unsigned)circ_id, chan,
U64_PRINTF_ARG(chan->global_identifier));
channel_write_cell(chan, &cell);
} else {
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)",
- 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->state);
}
log_warn(LD_CIRC,"failed to get unique circID.");
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);
memset(&cell, 0, sizeof(cell_t));
circuit_t *circ,
int conn_array_index,
const char *type,
- int this_circid,
- int other_circid)
+ circid_t this_circid,
+ circid_t other_circid)
{
- tor_log(severity, LD_CIRC, "Conn %d has %s circuit: circID %d "
- "(other side %d), state %d (%s), born %ld:",
- conn_array_index, type, this_circid, other_circid, circ->state,
- circuit_state_to_string(circ->state),
+ tor_log(severity, LD_CIRC, "Conn %d has %s circuit: circID %u "
+ "(other side %u), state %d (%s), born %ld:",
+ conn_array_index, type, (unsigned)this_circid, (unsigned)other_circid,
+ circ->state, circuit_state_to_string(circ->state),
(long)circ->timestamp_began.tv_sec);
if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */
circuit_log_path(severity, LD_CIRC, TO_ORIGIN_CIRCUIT(circ));
circuit_t *circ,
channel_t *chan,
const char *type,
- int this_circid,
- int other_circid)
+ circid_t this_circid,
+ circid_t other_circid)
{
- tor_log(severity, LD_CIRC, "Conn %p has %s circuit: circID %d "
- "(other side %d), state %d (%s), born %ld:",
- chan, type, this_circid, other_circid, circ->state,
+ tor_log(severity, LD_CIRC, "Conn %p has %s circuit: circID %u "
+ "(other side %u), state %d (%s), born %ld:",
+ chan, type, (unsigned)this_circid, (unsigned)other_circid, circ->state,
circuit_state_to_string(circ->state),
(long)circ->timestamp_began.tv_sec);
if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */
if (found && found->circuit) {
log_debug(LD_CIRC,
"circuit_get_by_circid_channel_impl() returning circuit %p for"
- " circ_id %d, channel ID " U64_FORMAT " (%p)",
- found->circuit, circ_id,
+ " circ_id %u, channel ID " U64_FORMAT " (%p)",
+ found->circuit, (unsigned)circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan);
return found->circuit;
}
log_debug(LD_CIRC,
"circuit_get_by_circid_channel_impl() found nothing for"
- " circ_id %d, channel ID " U64_FORMAT " (%p)",
- circ_id,
+ " circ_id %u, channel ID " U64_FORMAT " (%p)",
+ (unsigned)circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan);
return NULL;
} else {
/* Complain and move on */
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",
- to_remove->circ_id,
+ (unsigned)to_remove->circ_id,
U64_PRINTF_ARG(to_remove->chan_id));
}
} else {
/* Complain and move on */
log_warn(LD_CIRC,
- "Couldn't find circuit %d (for channel " U64_FORMAT ")",
- to_remove->circ_id,
+ "Couldn't find circuit %u (for channel " U64_FORMAT ")",
+ (unsigned)to_remove->circ_id,
U64_PRINTF_ARG(to_remove->chan_id));
}
} else {
/* Complain and move on */
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),
- to_remove->circ_id);
+ (unsigned)to_remove->circ_id);
}
/* Assert that we don't have un-freed policy data for this circuit */
log_info(LD_CIRC,
"Circuit %u on channel " U64_FORMAT " was already attached to "
"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) ?
circ->n_mux : TO_OR_CIRCUIT(circ)->p_mux),
cmux);
*/
log_debug(LD_CIRC,
"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
/* If we're already active, log a warning and finish */
if (already_active) {
log_warn(LD_CIRC,
- "Circuit %d on channel " U64_FORMAT " was already active",
- circ_id, U64_PRINTF_ARG(chan->global_identifier));
+ "Circuit %u on channel " U64_FORMAT " was already active",
+ (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier));
return;
}
if (already_inactive) {
log_warn(LD_CIRC,
"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;
}
case CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT:
case CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED:
/* 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",
- victim->n_circ_id,
+ (unsigned)victim->n_circ_id,
victim->state, circuit_state_to_string(victim->state),
victim->purpose);
TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1;
if (!(options->CloseHSServiceRendCircuitsImmediatelyOnTimeout) &&
!(TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out) &&
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.",
- victim->n_circ_id,
+ (unsigned)victim->n_circ_id,
victim->state, circuit_state_to_string(victim->state),
victim->purpose);
TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1;
"Abandoning circ %u %s:%d (state %d,%d:%s, purpose %d, "
"len %d)", TO_ORIGIN_CIRCUIT(victim)->global_identifier,
channel_get_canonical_remote_descr(victim->n_chan),
- victim->n_circ_id,
+ (unsigned)victim->n_circ_id,
TO_ORIGIN_CIRCUIT(victim)->has_opened,
victim->state, circuit_state_to_string(victim->state),
victim->purpose,
log_info(LD_CIRC,
"Abandoning circ %u %d (state %d,%d:%s, purpose %d, len %d)",
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,
circuit_state_to_string(victim->state), victim->purpose,
TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len);
circ->timestamp_dirty + get_options()->MaxCircuitDirtiness <
now.tv_sec &&
!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)",
- 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);
/* Don't do this magic for testing circuits. Their death is governed
* by circuit_expire_building */
!or_circ->n_streams && !or_circ->resolving_streams &&
or_circ->p_chan &&
channel_when_last_xmit(or_circ->p_chan) <= cutoff) {
- log_info(LD_CIRC, "Closing circ_id %d (empty %d secs ago)",
- or_circ->p_circ_id,
+ log_info(LD_CIRC, "Closing circ_id %u (empty %d secs ago)",
+ (unsigned)or_circ->p_circ_id,
(int)(now - channel_when_last_xmit(or_circ->p_chan)));
circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED);
}
const node_t *exitnode;
/* 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.",
- circ->base_.n_circ_id);
+ log_debug(LD_APP|LD_CIRC, "attaching new conn to circ. n_circ_id %u.",
+ (unsigned)circ->base_.n_circ_id);
/* reset it, so we can measure circ timeouts */
ENTRY_TO_CONN(apconn)->timestamp_lastread = time(NULL);
ENTRY_TO_EDGE_CONN(apconn)->next_stream = circ->p_streams;
return retval;
log_debug(LD_APP|LD_CIRC,
- "Attaching apconn to circ %d (stream %d sec old).",
- circ->base_.n_circ_id, conn_age);
+ "Attaching apconn to circ %u (stream %d sec old).",
+ (unsigned)circ->base_.n_circ_id, conn_age);
/* print the circ's path, so people can figure out which circs are
* sucking. */
circuit_log_path(LOG_INFO,LD_APP|LD_CIRC,circ);
log_info(LD_REND,
"rend joined circ %d already here. attaching. "
"(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
* them, since the process of rebuilding a rendezvous circ is so
* expensive. There is a tradeoff between linkability and
if (rendcirc && (rendcirc->base_.purpose ==
CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED)) {
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)",
- rendcirc->base_.n_circ_id, conn_age);
+ (unsigned)rendcirc->base_.n_circ_id, conn_age);
return 0;
}
if (retval > 0) {
/* one has already sent the intro. keep waiting. */
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)",
- introcirc->base_.n_circ_id,
- rendcirc ? rendcirc->base_.n_circ_id : 0,
+ (unsigned)introcirc->base_.n_circ_id,
+ rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0,
conn_age);
return 0;
}
if (rendcirc && introcirc &&
rendcirc->base_.purpose == CIRCUIT_PURPOSE_C_REND_READY) {
log_info(LD_REND,
- "ready rend circ %d already here (no intro-ack yet on "
- "intro %d). (stream %d sec old)",
- rendcirc->base_.n_circ_id,
- introcirc->base_.n_circ_id, conn_age);
+ "ready rend circ %u already here (no intro-ack yet on "
+ "intro %u). (stream %d sec old)",
+ (unsigned)rendcirc->base_.n_circ_id,
+ (unsigned)introcirc->base_.n_circ_id, conn_age);
tor_assert(introcirc->base_.purpose == CIRCUIT_PURPOSE_C_INTRODUCING);
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)",
- introcirc->base_.n_circ_id, rendcirc->base_.n_circ_id,
+ (unsigned)introcirc->base_.n_circ_id,
+ (unsigned)rendcirc->base_.n_circ_id,
conn_age);
switch (rend_client_send_introduction(introcirc, rendcirc)) {
case 0: /* success */
}
}
- 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)",
- introcirc ? introcirc->base_.n_circ_id : 0,
- rendcirc ? rendcirc->base_.n_circ_id : 0, conn_age);
+ introcirc ? (unsigned)introcirc->base_.n_circ_id : 0,
+ rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0, conn_age);
return 0;
}
}
* callbacks registered in command_setup_channel(),
* called when channels are created in circuitbuild.c
*/
-
#include "or.h"
#include "channel.h"
#include "circuitbuild.h"
tor_assert(chan);
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)",
- cell->circ_id,
+ (unsigned)cell->circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan);
if (we_are_hibernating()) {
(!id_is_high &&
chan->circ_id_type == CIRC_ID_TYPE_LOWER)) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- "Received create cell with unexpected circ_id %d. Closing.",
- cell->circ_id);
+ "Received create cell with unexpected circ_id %u. Closing.",
+ (unsigned)cell->circ_id);
channel_send_destroy(cell->circ_id, chan,
END_CIRC_REASON_TORPROTOCOL);
return;
if (circuit_id_in_use_on_channel(cell->circ_id, chan)) {
const node_t *node = node_get_by_id(chan->identity_digest);
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).",
- cell->circ_id, (int)(time(NULL) - channel_when_created(chan)));
+ (unsigned)cell->circ_id,
+ (int)(time(NULL) - channel_when_created(chan)));
if (node) {
char *p = esc_for_log(node_get_platform(node));
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
if (!circ) {
log_info(LD_OR,
- "(circID %d) unknown circ (probably got a destroy earlier). "
- "Dropping.", cell->circ_id);
+ "(circID %u) unknown circ (probably got a destroy earlier). "
+ "Dropping.", (unsigned)cell->circ_id);
return;
}
if (!circ) {
log_debug(LD_OR,
- "unknown circuit %d on connection from %s. Dropping.",
- cell->circ_id, channel_get_canonical_remote_descr(chan));
+ "unknown circuit %u on connection from %s. Dropping.",
+ (unsigned)cell->circ_id,
+ channel_get_canonical_remote_descr(chan));
return;
}
or_circuit_t *or_circ = TO_OR_CIRCUIT(circ);
if (or_circ->remaining_relay_early_cells == 0) {
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.",
- cell->circ_id,
+ (unsigned)cell->circ_id,
safe_str(channel_get_canonical_remote_descr(chan)));
circuit_mark_for_close(circ, END_CIRC_REASON_TORPROTOCOL);
return;
circ = circuit_get_by_circid_channel(cell->circ_id, chan);
if (!circ) {
- log_info(LD_OR,"unknown circuit %d on connection from %s. Dropping.",
- cell->circ_id, channel_get_canonical_remote_descr(chan));
+ log_info(LD_OR,"unknown circuit %u on connection from %s. Dropping.",
+ (unsigned)cell->circ_id,
+ channel_get_canonical_remote_descr(chan));
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];
connection_edge_destroy(circid_t circ_id, edge_connection_t *conn)
{
if (!conn->base_.marked_for_close) {
- log_info(LD_EDGE,
- "CircID %d: At an edge. Marking connection for close.", circ_id);
+ log_info(LD_EDGE, "CircID %u: At an edge. Marking connection for close.",
+ (unsigned) circ_id);
if (conn->base_.type == CONN_TYPE_AP) {
entry_connection_t *entry_conn = EDGE_TO_ENTRY_CONN(conn);
connection_mark_unattached_ap(entry_conn, END_STREAM_REASON_DESTROY);
edge_conn->deliver_window = STREAMWINDOW_START;
base_conn->state = AP_CONN_STATE_CONNECT_WAIT;
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);
+ ", n_circ_id %u",
+ base_conn->s, (unsigned)circ->base_.n_circ_id);
control_event_stream_status(ap_conn, STREAM_EVENT_SENT_CONNECT, 0);
/* If there's queued-up data, send it now */
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 "TOR_SOCKET_T_FORMAT
- ", n_circ_id %d",
- base_conn->s, circ->base_.n_circ_id);
+ ", n_circ_id %u",
+ 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_SENT_RESOLVE, 0);
return 0;
* \brief Functions to handle OR connections, TLS handshaking, and
* cells on the network.
**/
-
#include "or.h"
#include "buffers.h"
/*
*
* Right now, we only use this for processing onionskins.
**/
-
#include "or.h"
#include "buffers.h"
#include "channel.h"
circ = NULL;
log_debug(LD_OR,
"Unpacking cpuworker reply, chan_id is " U64_FORMAT
- ", circ_id is %d",
- U64_PRINTF_ARG(chan_id), circ_id);
+ ", circ_id is %u",
+ U64_PRINTF_ARG(chan_id), (unsigned)circ_id);
p_chan = channel_find_by_global_id(chan_id);
if (p_chan)
// XXX: should we not re-extend if hs_circ_has_timed_out?
if (circ->remaining_relay_early_cells) {
log_info(LD_REND,
- "Re-extending circ %d, this time to %s.",
- circ->base_.n_circ_id,
+ "Re-extending circ %u, this time to %s.",
+ (unsigned)circ->base_.n_circ_id,
safe_str_client(extend_info_describe(extend_info)));
result = circuit_extend_to_new_exit(circ, extend_info);
} else {
log_info(LD_REND,
- "Closing intro circ %d (out of RELAY_EARLY cells).",
- circ->base_.n_circ_id);
+ "Closing intro circ %u (out of RELAY_EARLY cells).",
+ (unsigned)circ->base_.n_circ_id);
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_FINISHED);
/* connection_ap_handshake_attach_circuit will launch a new intro circ. */
result = 0;
if (circ->base_.purpose != CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) {
log_warn(LD_PROTOCOL,
- "Received REND_INTRODUCE_ACK on unexpected circuit %d.",
- circ->base_.n_circ_id);
+ "Received REND_INTRODUCE_ACK on unexpected circuit %u.",
+ (unsigned)circ->base_.n_circ_id);
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL);
return -1;
}
int reason = END_CIRC_REASON_INTERNAL;
log_info(LD_REND,
- "Received an ESTABLISH_INTRO request on circuit %d",
- circ->p_circ_id);
+ "Received an ESTABLISH_INTRO request on circuit %u",
+ (unsigned) circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
memcpy(circ->rend_token, pk_digest, DIGEST_LEN);
log_info(LD_REND,
- "Established introduction point on circuit %d for service %s",
- circ->p_circ_id, safe_str(serviceid));
+ "Established introduction point on circuit %u for service %s",
+ (unsigned) circ->p_circ_id, safe_str(serviceid));
return 0;
truncated:
char serviceid[REND_SERVICE_ID_LEN_BASE32+1];
char nak_body[1];
- log_info(LD_REND, "Received an INTRODUCE1 request on circuit %d",
- circ->p_circ_id);
+ log_info(LD_REND, "Received an INTRODUCE1 request on circuit %u",
+ (unsigned)circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_warn(LD_PROTOCOL,
- "Rejecting INTRODUCE1 on non-OR or non-edge circuit %d.",
- circ->p_circ_id);
+ "Rejecting INTRODUCE1 on non-OR or non-edge circuit %u.",
+ (unsigned)circ->p_circ_id);
goto err;
}
*/
if (request_len < (DIGEST_LEN+(MAX_NICKNAME_LEN+1)+REND_COOKIE_LEN+
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.",
- circ->p_circ_id);
+ (unsigned)circ->p_circ_id);
goto err;
}
intro_circ = circuit_get_intro_point((char*)request);
if (!intro_circ) {
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.",
- safe_str(serviceid), circ->p_circ_id);
+ safe_str(serviceid), (unsigned)circ->p_circ_id);
goto err;
}
log_info(LD_REND,
"Sending introduction request for service %s "
- "from circ %d to circ %d",
- safe_str(serviceid), circ->p_circ_id,
- intro_circ->p_circ_id);
+ "from circ %u to circ %u",
+ safe_str(serviceid), (unsigned)circ->p_circ_id,
+ (unsigned)intro_circ->p_circ_id);
/* Great. Now we just relay the cell down the circuit. */
if (relay_send_command_from_edge(0, TO_CIRCUIT(intro_circ),
char hexid[9];
int reason = END_CIRC_REASON_TORPROTOCOL;
- log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %d",
- circ->p_circ_id);
+ log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %u",
+ (unsigned)circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_warn(LD_PROTOCOL,
base16_encode(hexid,9,(char*)request,4);
log_info(LD_REND,
- "Established rendezvous point on circuit %d for cookie %s",
- circ->p_circ_id, hexid);
+ "Established rendezvous point on circuit %u for cookie %s",
+ (unsigned)circ->p_circ_id, hexid);
return 0;
err:
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_info(LD_REND,
- "Tried to complete rendezvous on non-OR or non-edge circuit %d.",
- circ->p_circ_id);
+ "Tried to complete rendezvous on non-OR or non-edge circuit %u.",
+ (unsigned)circ->p_circ_id);
reason = END_CIRC_REASON_TORPROTOCOL;
goto err;
}
if (request_len != REND_COOKIE_LEN+DH_KEY_LEN+DIGEST_LEN) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %d.",
- (int)request_len, circ->p_circ_id);
+ "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %u.",
+ (int)request_len, (unsigned)circ->p_circ_id);
reason = END_CIRC_REASON_TORPROTOCOL;
goto err;
}
base16_encode(hexid, sizeof(hexid), (const char*)request, 4);
log_info(LD_REND,
- "Got request for rendezvous from circuit %d to cookie %s.",
- circ->p_circ_id, hexid);
+ "Got request for rendezvous from circuit %u to cookie %s.",
+ (unsigned)circ->p_circ_id, hexid);
rend_circ = circuit_get_rendezvous((char*)request);
if (!rend_circ) {
(char*)(request+REND_COOKIE_LEN),
request_len-REND_COOKIE_LEN, NULL)) {
log_warn(LD_GENERAL,
- "Unable to send RENDEZVOUS2 cell to client on circuit %d.",
- rend_circ->p_circ_id);
+ "Unable to send RENDEZVOUS2 cell to client on circuit %u.",
+ (unsigned)rend_circ->p_circ_id);
goto err;
}
/* Join the circuits. */
log_info(LD_REND,
- "Completing rendezvous: circuit %d joins circuit %d (cookie %s)",
- circ->p_circ_id, rend_circ->p_circ_id, hexid);
+ "Completing rendezvous: circuit %u joins circuit %u (cookie %s)",
+ (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(rend_circ),
/* Do some initial validation and logging before we parse the cell */
if (circuit->base_.purpose != CIRCUIT_PURPOSE_S_INTRO) {
log_warn(LD_PROTOCOL,
- "Got an INTRODUCE2 over a non-introduction circuit %d.",
- circuit->base_.n_circ_id);
+ "Got an INTRODUCE2 over a non-introduction circuit %u.",
+ (unsigned) circuit->base_.n_circ_id);
goto err;
}
goto err;
}
- log_info(LD_REND, "Received INTRODUCE2 cell for service %s on circ %d.",
- escaped(serviceid), circuit->base_.n_circ_id);
+ log_info(LD_REND, "Received INTRODUCE2 cell for service %s on circ %u.",
+ escaped(serviceid), (unsigned)circuit->base_.n_circ_id);
/* use intro key instead of service key. */
intro_key = circuit->intro_key;
if (!parsed_req) {
goto log_error;
} 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);
}
if (result < 0) {
goto log_error;
} 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);
}
if (result < 0) {
goto log_error;
} 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);
}
if (result < 0) {
goto log_error;
} 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);
}
if (result < 0) {
goto log_error;
} 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);
}
stage_descr = NULL;
}
}
- 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:
status = -1;
if (dh) crypto_dh_free(dh);
service = rend_service_get_by_pk_digest(
circuit->rend_data->rend_pk_digest);
if (!service) {
- log_warn(LD_REND, "Unrecognized service ID %s on introduction circuit %d.",
- serviceid, circuit->base_.n_circ_id);
+ log_warn(LD_REND, "Unrecognized service ID %s on introduction circuit %u.",
+ serviceid, (unsigned)circuit->base_.n_circ_id);
reason = END_CIRC_REASON_NOSUCHSERVICE;
goto err;
}
}
log_info(LD_REND,
- "Established circuit %d as introduction point for service %s",
- circuit->base_.n_circ_id, serviceid);
+ "Established circuit %u as introduction point for service %s",
+ (unsigned)circuit->base_.n_circ_id, serviceid);
/* Use the intro key instead of the service key in ESTABLISH_INTRO. */
intro_key = circuit->intro_key;
RELAY_COMMAND_ESTABLISH_INTRO,
buf, len, circuit->cpath->prev)<0) {
log_info(LD_GENERAL,
- "Couldn't send introduction request for service %s on circuit %d",
- serviceid, circuit->base_.n_circ_id);
+ "Couldn't send introduction request for service %s on circuit %u",
+ serviceid, (unsigned)circuit->base_.n_circ_id);
reason = END_CIRC_REASON_INTERNAL;
goto err;
}
service = rend_service_get_by_pk_digest(
circuit->rend_data->rend_pk_digest);
if (!service) {
- log_warn(LD_REND, "Unknown service on introduction circuit %d.",
- circuit->base_.n_circ_id);
+ log_warn(LD_REND, "Unknown service on introduction circuit %u.",
+ (unsigned)circuit->base_.n_circ_id);
goto err;
}
service->desc_is_dirty = time(NULL);
base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32 + 1,
circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN);
log_info(LD_REND,
- "Received INTRO_ESTABLISHED cell on circuit %d for service %s",
- circuit->base_.n_circ_id, serviceid);
+ "Received INTRO_ESTABLISHED cell on circuit %u for service %s",
+ (unsigned)circuit->base_.n_circ_id, serviceid);
/* Getting a valid INTRODUCE_ESTABLISHED means we've successfully
* used the circ */
circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN);
log_info(LD_REND,
- "Done building circuit %d to rendezvous with "
+ "Done building circuit %u to rendezvous with "
"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
* consistency with what happens on the client side; this line has
circ->rend_data->rend_pk_digest);
if (!service) {
log_warn(LD_REND, "Couldn't find any service associated with pk %s on "
- "rendezvous circuit %d; closing.",
- serviceid, circ->base_.n_circ_id);
+ "rendezvous circuit %u; closing.",
+ serviceid, (unsigned)circ->base_.n_circ_id);
return -1;
}
matching_ports = smartlist_new();