summaryrefslogtreecommitdiff
path: root/src/or/connection_exit.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-06-17 22:18:26 +0000
committerNick Mathewson <nickm@torproject.org>2003-06-17 22:18:26 +0000
commit95e5384af3edf2804275ce97b331fcface8365f0 (patch)
tree073a16b76b56f6f9d0c9c5c9cb887c4a2a501896 /src/or/connection_exit.c
parent6965a4696cf3b00a1f385cf3f3a562897fefdb09 (diff)
downloadtor-95e5384af3edf2804275ce97b331fcface8365f0.tar.gz
tor-95e5384af3edf2804275ce97b331fcface8365f0.zip
Change many files to new log_fn format
svn:r333
Diffstat (limited to 'src/or/connection_exit.c')
-rw-r--r--src/or/connection_exit.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/or/connection_exit.c b/src/or/connection_exit.c
index 9bcda85dc0..88f27d2cb9 100644
--- a/src/or/connection_exit.c
+++ b/src/or/connection_exit.c
@@ -9,25 +9,25 @@ int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) {
char *colon;
if(!memchr(cell->payload+RELAY_HEADER_SIZE+STREAM_ID_SIZE,0,cell->length-RELAY_HEADER_SIZE-STREAM_ID_SIZE)) {
- log(LOG_WARNING,"connection_exit_begin_conn(): relay begin cell has no \\0. Dropping.");
+ log_fn(LOG_WARNING,"relay begin cell has no \\0. Dropping.");
return 0;
}
colon = strchr(cell->payload+RELAY_HEADER_SIZE+STREAM_ID_SIZE, ':');
if(!colon) {
- log(LOG_WARNING,"connection_exit_begin_conn(): relay begin cell has no colon. Dropping.");
+ log_fn(LOG_WARNING,"relay begin cell has no colon. Dropping.");
return 0;
}
*colon = 0;
if(!atoi(colon+1)) { /* bad port */
- log(LOG_DEBUG,"connection_exit_begin_conn(): relay begin cell has invalid port. Dropping.");
+ log_fn(LOG_DEBUG,"relay begin cell has invalid port. Dropping.");
return 0;
}
- log(LOG_DEBUG,"connection_exit_begin_conn(): Creating new exit connection.");
+ log_fn(LOG_DEBUG,"Creating new exit connection.");
n_stream = connection_new(CONN_TYPE_EXIT);
if(!n_stream) {
- log(LOG_DEBUG,"connection_exit_begin_conn(): connection_new failed. Dropping.");
+ log_fn(LOG_DEBUG,"connection_new failed. Dropping.");
return 0;
}
@@ -41,7 +41,7 @@ int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) {
n_stream->package_window = STREAMWINDOW_START;
n_stream->deliver_window = STREAMWINDOW_START;
if(connection_add(n_stream) < 0) { /* no space, forget it */
- log(LOG_DEBUG,"connection_exit_begin_conn(): connection_add failed. Dropping.");
+ log_fn(LOG_DEBUG,"connection_add failed. Dropping.");
connection_free(n_stream);
return 0;
}
@@ -52,7 +52,7 @@ int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) {
/* send it off to the gethostbyname farm */
if(dns_resolve(n_stream) < 0) {
- log(LOG_DEBUG,"connection_exit_begin_conn(): Couldn't queue resolve request.");
+ log_fn(LOG_DEBUG,"Couldn't queue resolve request.");
connection_remove(n_stream);
connection_free(n_stream);
return 0;
@@ -66,14 +66,14 @@ int connection_exit_connect(connection_t *conn) {
struct sockaddr_in dest_addr;
if(router_compare_to_exit_policy(conn) < 0) {
- log(LOG_INFO,"connection_exit_connect(): %s:%d failed exit policy. Closing.", conn->address, conn->port);
+ log_fn(LOG_INFO,"%s:%d failed exit policy. Closing.", conn->address, conn->port);
return -1;
}
/* all the necessary info is here. Start the connect() */
s=socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
if (s < 0) {
- log(LOG_ERR,"connection_exit_connect(): Error creating network socket.");
+ log_fn(LOG_ERR,"Error creating network socket.");
return -1;
}
fcntl(s, F_SETFL, O_NONBLOCK); /* set s to non-blocking */
@@ -83,13 +83,13 @@ int connection_exit_connect(connection_t *conn) {
dest_addr.sin_port = htons(conn->port);
dest_addr.sin_addr.s_addr = htonl(conn->addr);
- log(LOG_DEBUG,"connection_exit_connect(): Connecting to %s:%u.",conn->address,conn->port);
+ log_fn(LOG_DEBUG,"Connecting to %s:%u.",conn->address,conn->port);
if(connect(s,(struct sockaddr *)&dest_addr,sizeof(dest_addr)) < 0) {
if(errno != EINPROGRESS){
/* yuck. kill it. */
perror("connect");
- log(LOG_DEBUG,"connection_exit_connect(): Connect failed.");
+ log_fn(LOG_DEBUG,"Connect failed.");
return -1;
} else {
/* it's in progress. set state appropriately and return. */
@@ -97,20 +97,20 @@ int connection_exit_connect(connection_t *conn) {
connection_set_poll_socket(conn);
conn->state = EXIT_CONN_STATE_CONNECTING;
- log(LOG_DEBUG,"connection_exit_connect(): connect in progress, socket %d.",s);
+ log_fn(LOG_DEBUG,"connect in progress, socket %d.",s);
connection_watch_events(conn, POLLOUT | POLLIN);
return 0;
}
}
/* it succeeded. we're connected. */
- log(LOG_DEBUG,"connection_exit_connect(): Connection to %s:%u established.",conn->address,conn->port);
+ log_fn(LOG_DEBUG,"Connection to %s:%u established.",conn->address,conn->port);
conn->s = s;
connection_set_poll_socket(conn);
conn->state = EXIT_CONN_STATE_OPEN;
if(connection_wants_to_flush(conn)) { /* in case there are any queued data cells */
- log(LOG_ERR,"connection_exit_connect(): tell roger: newly connected conn had data waiting!");
+ log_fn(LOG_ERR,"tell roger: newly connected conn had data waiting!");
// connection_start_writing(conn);
}
// connection_process_inbuf(conn);