From cd0760ddda650c147ba21b933cebef5008eb645e Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Mon, 22 Jul 2002 04:08:37 +0000 Subject: Code cleaned up to be less noisy svn:r71 --- src/or/circuit.c | 6 +++--- src/or/connection.c | 4 ++-- src/or/connection_ap.c | 5 +++-- src/or/main.c | 6 ++---- src/or/routers.c | 32 ++++++++++---------------------- 5 files changed, 20 insertions(+), 33 deletions(-) diff --git a/src/or/circuit.c b/src/or/circuit.c index 2758c13d21..52578d15b3 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -262,15 +262,15 @@ int circuit_deliver_data_cell(cell_t *cell, circuit_t *circ, connection_t *conn, } if(conn->type == CONN_TYPE_EXIT) { /* send payload directly */ - log(LOG_DEBUG,"circuit_deliver_data_cell(): Sending to exit."); +// log(LOG_DEBUG,"circuit_deliver_data_cell(): Sending to exit."); return connection_exit_process_data_cell(cell, conn); } if(conn->type == CONN_TYPE_AP) { /* send payload directly */ - log(LOG_DEBUG,"circuit_deliver_data_cell(): Sending to AP."); +// log(LOG_DEBUG,"circuit_deliver_data_cell(): Sending to AP."); return connection_ap_process_data_cell(cell, conn); } /* else send it as a cell */ - log(LOG_DEBUG,"circuit_deliver_data_cell(): Sending to connection."); +// log(LOG_DEBUG,"circuit_deliver_data_cell(): Sending to connection."); return connection_write_cell_to_buf(cell, conn); } diff --git a/src/or/connection.c b/src/or/connection.c index aca385ffba..bd6274098e 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -465,14 +465,14 @@ int connection_send_destroy(aci_t aci, connection_t *conn) { assert(conn); if(!connection_speaks_cells(conn)) { - log(LOG_DEBUG,"connection_send_destroy(): At an edge. Marking connection for close."); + log(LOG_INFO,"connection_send_destroy(): Aci %d: At an edge. Marking connection for close.", aci); conn->marked_for_close = 1; return 0; } cell.aci = aci; cell.command = CELL_DESTROY; - log(LOG_DEBUG,"connection_send_destroy(): Sending destroy (aci %d).",aci); + log(LOG_INFO,"connection_send_destroy(): Sending destroy (aci %d).",aci); return connection_write_cell_to_buf(&cell, conn); } diff --git a/src/or/connection_ap.c b/src/or/connection_ap.c index a25e3d7f44..4996f9d881 100644 --- a/src/or/connection_ap.c +++ b/src/or/connection_ap.c @@ -16,7 +16,7 @@ int connection_ap_process_inbuf(connection_t *conn) { return -1; } - log(LOG_DEBUG,"connection_ap_process_inbuf(): state %d.",conn->state); +// log(LOG_DEBUG,"connection_ap_process_inbuf(): state %d.",conn->state); switch(conn->state) { case AP_CONN_STATE_SS_WAIT: @@ -329,6 +329,7 @@ int ap_handshake_send_onion(connection_t *ap_conn, connection_t *n_conn, circuit circ->state = CIRCUIT_STATE_OPEN; ap_conn->state = AP_CONN_STATE_OPEN; + log(LOG_INFO,"ap_handshake_send_onion(): Address/port sent, ap socket %d, n_aci %d",ap_conn->s,circ->n_aci); /* FIXME should set circ->expire to something here */ @@ -351,7 +352,7 @@ int connection_ap_process_data_cell(cell_t *cell, connection_t *conn) { return -1; } - log(LOG_DEBUG,"connection_ap_process_data_cell(): In state 'open', writing to buf."); +// log(LOG_DEBUG,"connection_ap_process_data_cell(): In state 'open', writing to buf."); if(connection_write_to_buf(cell->payload, cell->length, conn) < 0) return -1; diff --git a/src/or/main.c b/src/or/main.c index c96cf3930d..dadfd9aa7a 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -68,13 +68,13 @@ int connection_remove(connection_t *conn) { assert(conn); assert(nfds>0); + log(LOG_INFO,"connection_remove(): removing socket %d, nfds now %d",conn->s, nfds-1); circuit_about_to_close_connection(conn); /* flush and send destroys for all circuits on this conn */ current_index = conn->poll_index; if(current_index == nfds-1) { /* this is the end */ // connection_free(conn); nfds--; - log(LOG_INFO,"connection_remove(): nfds now %d.",nfds); return 0; } @@ -86,8 +86,6 @@ int connection_remove(connection_t *conn) { connection_array[current_index] = connection_array[nfds]; connection_array[current_index]->poll_index = current_index; - log(LOG_INFO,"connection_remove(): nfds now %d.",nfds); - return 0; } @@ -285,7 +283,7 @@ void check_conn_read(int i) { } if(retval < 0) { /* this connection is broken. remove it */ - log(LOG_DEBUG,"check_conn_read(): Connection broken, removing."); + log(LOG_INFO,"check_conn_read(): Connection broken, removing."); connection_remove(conn); connection_free(conn); if(iconn_bufs = NULL; /* no output buffers */ - router->last_conn_buf = NULL; - router->next_to_service = 0; - - router->s = -1; /* to signify this router is as yet unconnected */ - router->celllen = 0; /* cell buffer is empty */ -#endif - /* read the address */ router->address = malloc(strlen(token)+1); if (!router->address) @@ -315,7 +302,7 @@ routerinfo_t **getrouters(char *routerfile, size_t *lenp, uint16_t or_listenport } /* check that this router doesn't actually represent us */ - retval = routers_is_us(router->addr, router->or_port, or_listenport); + retval = router_is_me(router->addr, router->or_port, or_listenport); if (!retval) { /* this isn't us, continue */ router->next = NULL; /* save the entry into the routerlist linked list */ @@ -332,7 +319,7 @@ routerinfo_t **getrouters(char *routerfile, size_t *lenp, uint16_t or_listenport RSA_free(router->pkey); free((void *)router); } - else /* routers_is_us() returned an error */ + else /* router_is_me() returned an error */ { free((void *)router->address); RSA_free(router->pkey); @@ -430,3 +417,4 @@ routerinfo_t **getrouters(char *routerfile, size_t *lenp, uint16_t or_listenport fclose(rf); return make_rarray(routerlist, lenp); } + -- cgit v1.2.3-54-g00ecf