Change many files to new log_fn format

svn:r333
This commit is contained in:
Nick Mathewson
2003-06-17 22:18:26 +00:00
parent 6965a4696c
commit 95e5384af3
15 changed files with 251 additions and 248 deletions
+20 -20
View File
@@ -22,7 +22,7 @@ void command_time_process_cell(cell_t *cell, connection_t *conn,
time_passed = tv_udiff(&start, &end) ;
if (time_passed > 5000) { /* more than 5ms */
log(LOG_INFO,"command_time_process_cell(): That call just took %d ms.",time_passed/1000);
log_fn(LOG_INFO,"That call just took %ld ms.",time_passed/1000);
}
*time += time_passed;
}
@@ -83,14 +83,14 @@ void command_process_create_cell(cell_t *cell, connection_t *conn) {
circ = circuit_get_by_aci_conn(cell->aci, conn);
if(circ) {
log(LOG_DEBUG,"command_process_create_cell(): received CREATE cell for known circ. Dropping.");
log_fn(LOG_DEBUG,"received CREATE cell for known circ. Dropping.");
return;
}
circ = circuit_new(cell->aci, conn);
circ->state = CIRCUIT_STATE_ONIONSKIN_PENDING;
if(cell->length != DH_ONIONSKIN_LEN) {
log(LOG_DEBUG,"command_process_create_cell(): Bad cell length %d. Dropping.", cell->length);
log_fn(LOG_DEBUG,"Bad cell length %d. Dropping.", cell->length);
circuit_close(circ);
return;
}
@@ -99,10 +99,10 @@ void command_process_create_cell(cell_t *cell, connection_t *conn) {
/* add it to the pending onions queue, and then return */
if(onion_pending_add(circ) < 0) {
log(LOG_DEBUG,"command_process_create_cell(): Failed to queue onionskin. Closing.");
log_fn(LOG_DEBUG,"Failed to queue onionskin. Closing.");
circuit_close(circ);
}
log(LOG_DEBUG,"command_process_create_cell(): success: queued onionskin.");
log_fn(LOG_DEBUG,"success: queued onionskin.");
return;
}
@@ -113,26 +113,26 @@ void command_process_created_cell(cell_t *cell, connection_t *conn) {
circ = circuit_get_by_aci_conn(cell->aci, conn);
if(!circ) {
log(LOG_DEBUG,"command_process_created_cell(): received CREATED cell for unknown circ. Dropping.");
log_fn(LOG_DEBUG,"received CREATED cell for unknown circ. Dropping.");
return;
}
if(circ->n_aci != cell->aci) {
log(LOG_DEBUG,"command_process_created_cell(): got created cell from OPward? Dropping.");
log_fn(LOG_DEBUG,"got created cell from OPward? Dropping.");
return;
}
assert(cell->length == DH_KEY_LEN);
if(circ->cpath) { /* we're the OP. Handshake this. */
log(LOG_DEBUG,"command_process_created_cell(): at OP. Finishing handshake.");
log_fn(LOG_DEBUG,"at OP. Finishing handshake.");
if(circuit_finish_handshake(circ, cell->payload) < 0) {
log(LOG_INFO,"command_process_created_cell(): circuit_finish_handshake failed.");
log_fn(LOG_INFO,"circuit_finish_handshake failed.");
circuit_close(circ);
return;
}
log(LOG_DEBUG,"command_process_created_cell(): Moving to next skin.");
log_fn(LOG_DEBUG,"Moving to next skin.");
if(circuit_send_next_onion_skin(circ) < 0) {
log(LOG_INFO,"command_process_created_cell(): circuit_send_next_onion_skin failed.");
log_fn(LOG_INFO,"circuit_send_next_onion_skin failed.");
circuit_close(circ);
return;
}
@@ -146,9 +146,9 @@ void command_process_created_cell(cell_t *cell, connection_t *conn) {
newcell.length = RELAY_HEADER_SIZE + cell->length;
memcpy(newcell.payload+RELAY_HEADER_SIZE, cell->payload, DH_KEY_LEN);
log(LOG_DEBUG,"command_process_created_cell(): Sending extended relay cell.");
log_fn(LOG_DEBUG,"Sending extended relay cell.");
if(circuit_deliver_relay_cell(&newcell, circ, CELL_DIRECTION_IN, NULL) < 0) {
log(LOG_DEBUG,"command_process_created_cell(): failed to deliver extended cell. Closing.");
log_fn(LOG_DEBUG,"failed to deliver extended cell. Closing.");
circuit_close(circ);
return;
}
@@ -162,26 +162,26 @@ void command_process_relay_cell(cell_t *cell, connection_t *conn) {
circ = circuit_get_by_aci_conn(cell->aci, conn);
if(!circ) {
log(LOG_DEBUG,"command_process_relay_cell(): unknown circuit %d. Dropping.", cell->aci);
log_fn(LOG_DEBUG,"unknown circuit %d. Dropping.", cell->aci);
return;
}
if(circ->state == CIRCUIT_STATE_ONIONSKIN_PENDING) {
log(LOG_DEBUG,"command_process_relay_cell(): circuit in create_wait. Dropping.");
log_fn(LOG_DEBUG,"circuit in create_wait. Dropping.");
return;
}
if(cell->aci == circ->p_aci) { /* it's an outgoing cell */
cell->aci = circ->n_aci; /* switch it */
if(circuit_deliver_relay_cell(cell, circ, CELL_DIRECTION_OUT, conn->cpath_layer) < 0) {
log(LOG_INFO,"command_process_relay_cell(): circuit_deliver_relay_cell (forward) failed. Closing.");
log_fn(LOG_INFO,"circuit_deliver_relay_cell (forward) failed. Closing.");
circuit_close(circ);
return;
}
} else { /* it's an ingoing cell */
cell->aci = circ->p_aci; /* switch it */
if(circuit_deliver_relay_cell(cell, circ, CELL_DIRECTION_IN, NULL) < 0) {
log(LOG_DEBUG,"command_process_relay_cell(): circuit_deliver_relay_cell (backward) failed. Closing.");
log_fn(LOG_DEBUG,"circuit_deliver_relay_cell (backward) failed. Closing.");
circuit_close(circ);
return;
}
@@ -194,11 +194,11 @@ void command_process_destroy_cell(cell_t *cell, connection_t *conn) {
circ = circuit_get_by_aci_conn(cell->aci, conn);
if(!circ) {
log(LOG_DEBUG,"command_process_destroy_cell(): unknown circuit %d. Dropping.", cell->aci);
log_fn(LOG_DEBUG,"unknown circuit %d. Dropping.", cell->aci);
return;
}
log(LOG_DEBUG,"command_process_destroy_cell(): Received for aci %d.",cell->aci);
log_fn(LOG_DEBUG,"Received for aci %d.",cell->aci);
if(circ->state == CIRCUIT_STATE_ONIONSKIN_PENDING) {
onion_pending_remove(circ);
}
@@ -209,7 +209,7 @@ void command_process_destroy_cell(cell_t *cell, connection_t *conn) {
circuit_close(circ);
} else { /* the destroy came from ahead */
circ->n_conn = NULL;
log(LOG_DEBUG, "command_process_destroy_cell(): Delivering 'truncated' back.");
log_fn(LOG_DEBUG, "Delivering 'truncated' back.");
connection_edge_send_command(NULL, circ, RELAY_COMMAND_TRUNCATED);
}
}