aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-03-27 04:55:13 +0000
committerRoger Dingledine <arma@torproject.org>2005-03-27 04:55:13 +0000
commit36baf7219d458449cbbdac9b61cc34492f85fb88 (patch)
tree4b618242ed0830bdc1a7c520cf0720c35bb76988 /src/or/main.c
parentefb5db449a13a6cf87799c71a84b18b144e6e163 (diff)
downloadtor-36baf7219d458449cbbdac9b61cc34492f85fb88.tar.gz
tor-36baf7219d458449cbbdac9b61cc34492f85fb88.zip
stop most cases of hanging up on a socks connection without sending
the socks reject. audit for remaining ones. also make things more uniform so we always remember to hold-open-until-flushed, etc. svn:r3891
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 706ce05de0..860696197e 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -476,11 +476,10 @@ void directory_all_unreachable(time_t now) {
while ((conn = connection_get_by_type_state(CONN_TYPE_AP,
AP_CONN_STATE_CIRCUIT_WAIT))) {
- conn->has_sent_end = 1; /* it's not connected anywhere, so no need to end */
log_fn(LOG_NOTICE,"Network down? Failing connection to '%s:%d'.",
conn->socks_request->address, conn->socks_request->port);
- connection_ap_handshake_socks_reply(conn, NULL, 0, SOCKS5_NET_UNREACHABLE);
- connection_mark_for_close(conn);
+ connection_close_unattached_ap(conn, END_STREAM_REASON_TIMEOUT);
+// XXX should maybe reflect SOCKS5_NET_UNREACHABLE here. what reason is that?
}
}
@@ -589,14 +588,14 @@ static void run_connection_housekeeping(int i, time_t now) {
conn->hold_open_until_flushed = 1;
} else if (!clique_mode(options) && !circuit_get_by_conn(conn) &&
(!router || !server_mode(options) || !router_is_clique_mode(router))) {
- log_fn(LOG_INFO,"Expiring non-used connection to %d (%s:%d) [Not in clique mode].",
+ log_fn(LOG_INFO,"Expiring non-used OR connection to %d (%s:%d) [Not in clique mode].",
i,conn->address, conn->port);
connection_mark_for_close(conn);
conn->hold_open_until_flushed = 1;
} else if (
now >= conn->timestamp_lastempty + options->KeepalivePeriod*10 &&
now >= conn->timestamp_lastwritten + options->KeepalivePeriod*10) {
- log_fn(LOG_NOTICE,"Expiring stuck connection to %d (%s:%d). (%d bytes to flush; %d seconds since last write)",
+ log_fn(LOG_NOTICE,"Expiring stuck OR connection to %d (%s:%d). (%d bytes to flush; %d seconds since last write)",
i, conn->address, conn->port,
(int)buf_datalen(conn->outbuf),
(int)(now-conn->timestamp_lastwritten));