diff options
author | Roger Dingledine <arma@torproject.org> | 2004-03-03 04:54:16 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-03-03 04:54:16 +0000 |
commit | 8275e2302ca3995f15a0b78e7a5341230653694c (patch) | |
tree | e6d2847d922f9d73f6f7b857b1a20aa621363902 /src/or/connection_edge.c | |
parent | 77bb3e054e76e9641b750db6cd6826e1c6096a9e (diff) | |
download | tor-8275e2302ca3995f15a0b78e7a5341230653694c.tar.gz tor-8275e2302ca3995f15a0b78e7a5341230653694c.zip |
make socks5 not give a spurious warning
also rename AP_CONN_STATE_CONNECTING to _CONNECT_WAIT
svn:r1208
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 7207800ed5..ced8baacbf 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -220,7 +220,7 @@ int connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, connection return 0; } if(conn->type == CONN_TYPE_AP && rh.command == RELAY_COMMAND_CONNECTED) { - if(conn->state != AP_CONN_STATE_CONNECTING) { + if(conn->state != AP_CONN_STATE_CONNECT_WAIT) { log_fn(LOG_WARN,"Got 'connected' while not in state connecting. Dropping."); return 0; } @@ -445,6 +445,7 @@ int connection_edge_finished_flushing(connection_t *conn) { return 0; case AP_CONN_STATE_SOCKS_WAIT: case AP_CONN_STATE_CIRCUIT_WAIT: + case AP_CONN_STATE_CONNECT_WAIT: connection_stop_writing(conn); return 0; default: @@ -539,7 +540,7 @@ void connection_ap_expire_beginning(void) { for (i = 0; i < n; ++i) { conn = carray[i]; if (conn->type != CONN_TYPE_AP || - conn->state != AP_CONN_STATE_CONNECTING) + conn->state != AP_CONN_STATE_CONNECT_WAIT) continue; if (now - conn->timestamp_lastread >= 15) { log_fn(LOG_WARN,"Stream is %d seconds late. Retrying.", @@ -770,7 +771,7 @@ static void connection_ap_handshake_send_begin(connection_t *ap_conn, circuit_t ap_conn->package_window = STREAMWINDOW_START; ap_conn->deliver_window = STREAMWINDOW_START; - ap_conn->state = AP_CONN_STATE_CONNECTING; + ap_conn->state = AP_CONN_STATE_CONNECT_WAIT; /* XXX Right now, we rely on the socks client not to send us any data * XXX until we've sent back a socks reply. (If it does, we could wind * XXX up packaging that data and sending it to the exit, then later having @@ -786,7 +787,7 @@ static int connection_ap_handshake_socks_reply(connection_t *conn, char *reply, if(replylen) { /* we already have a reply in mind */ connection_write_to_buf(reply, replylen, conn); - return flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen); /* try to flush it */ + return 0; } assert(conn->socks_request); if(conn->socks_request->socks_version == 4) { @@ -796,7 +797,6 @@ static int connection_ap_handshake_socks_reply(connection_t *conn, char *reply, buf[1] = (success ? SOCKS4_GRANTED : SOCKS4_REJECT); /* leave version, destport, destip zero */ connection_write_to_buf(buf, SOCKS4_NETWORK_LEN, conn); - return flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen); /* try to flush it */ } if(conn->socks_request->socks_version == 5) { buf[0] = 5; /* version 5 */ @@ -808,9 +808,9 @@ static int connection_ap_handshake_socks_reply(connection_t *conn, char *reply, memset(buf+4,0,6); /* Set external addr/port to 0. The spec doesn't seem to say what to do here. -RD */ connection_write_to_buf(buf,10,conn); - return flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen); /* try to flush it */ } - return 0; /* if socks_version isn't 4 or 5, don't send anything */ + /* if socks_version isn't 4 or 5, don't send anything */ + return 0; } static int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) { |