diff options
author | Roger Dingledine <arma@torproject.org> | 2005-03-27 06:37:56 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-03-27 06:37:56 +0000 |
commit | 7a79acd9f6d377533940ee12fcb3afaaa982b04d (patch) | |
tree | e49a435a3f3a5fc4f4cda38aa060d010675988c9 /src/or/relay.c | |
parent | ce854906db41e8e21a9cb8d42fcb63e469ca2b28 (diff) | |
download | tor-7a79acd9f6d377533940ee12fcb3afaaa982b04d.tar.gz tor-7a79acd9f6d377533940ee12fcb3afaaa982b04d.zip |
clean up socks reply stuff more.
add a few more reasons so we can be more informative.
svn:r3895
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 32277fd82d..4b79f17463 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -500,13 +500,13 @@ connection_edge_end_reason_socks5_response(int reason) case END_STREAM_REASON_CONNECTREFUSED: return SOCKS5_CONNECTION_REFUSED; case END_STREAM_REASON_EXITPOLICY: - return SOCKS5_CONNECTION_REFUSED; // XXX should be SOCKS5_NOT_ALLOWED ? + return SOCKS5_NOT_ALLOWED; case END_STREAM_REASON_DESTROY: return SOCKS5_GENERAL_ERROR; case END_STREAM_REASON_DONE: return SOCKS5_SUCCEEDED; case END_STREAM_REASON_TIMEOUT: - return SOCKS5_TTL_EXPIRED; // XXX is this correct? + return SOCKS5_TTL_EXPIRED; case END_STREAM_REASON_RESOURCELIMIT: return SOCKS5_GENERAL_ERROR; case END_STREAM_REASON_HIBERNATING: @@ -517,6 +517,13 @@ connection_edge_end_reason_socks5_response(int reason) return SOCKS5_CONNECTION_REFUSED; case END_STREAM_REASON_TORPROTOCOL: return SOCKS5_GENERAL_ERROR; + + case END_STREAM_REASON_ALREADY_SOCKS_REPLIED: + return SOCKS5_SUCCEEDED; /* never used */ + case END_STREAM_REASON_CANT_ATTACH: + return SOCKS5_GENERAL_ERROR; + case END_STREAM_REASON_NET_UNREACHABLE: + return SOCKS5_NET_UNREACHABLE; default: log_fn(LOG_WARN,"Reason for ending (%d) not recognized.",reason); return SOCKS5_GENERAL_ERROR; @@ -716,7 +723,7 @@ connection_edge_process_relay_cell_not_open( cell->payload[RELAY_HEADER_SIZE], /*answer_type*/ cell->payload[RELAY_HEADER_SIZE+1], /*answer_len*/ cell->payload+RELAY_HEADER_SIZE+2); /* answer */ - connection_close_unattached_ap(conn, END_STREAM_REASON_DONE); + connection_close_unattached_ap(conn, END_STREAM_REASON_ALREADY_SOCKS_REPLIED); return 0; } |