mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
fix bug found by Adam J. Richter: directory clients shouldn't
hang up five minutes after they begin. but directory servers should still hang up after 5 minutes of failing to deliver any bytes. svn:r8271
This commit is contained in:
parent
a76e032b14
commit
f75ef94f27
@ -597,7 +597,7 @@ run_connection_housekeeping(int i, time_t now)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Expire any directory connections that haven't sent anything for 5 min */
|
/* Expire any directory connections that haven't sent anything for 5 min */
|
||||||
if (conn->type == CONN_TYPE_DIR &&
|
if (conn->type == CONN_TYPE_DIR && DIR_CONN_IS_SERVER(conn) &&
|
||||||
conn->timestamp_lastwritten + DIR_CONN_MAX_STALL < now) {
|
conn->timestamp_lastwritten + DIR_CONN_MAX_STALL < now) {
|
||||||
log_info(LD_DIR,"Expiring wedged directory conn (fd %d, purpose %d)",
|
log_info(LD_DIR,"Expiring wedged directory conn (fd %d, purpose %d)",
|
||||||
conn->s, conn->purpose);
|
conn->s, conn->purpose);
|
||||||
|
@ -305,6 +305,8 @@ typedef enum {
|
|||||||
#define DIR_CONN_STATE_SERVER_WRITING 6
|
#define DIR_CONN_STATE_SERVER_WRITING 6
|
||||||
#define _DIR_CONN_STATE_MAX 6
|
#define _DIR_CONN_STATE_MAX 6
|
||||||
|
|
||||||
|
#define DIR_CONN_IS_SERVER(conn) ((conn)->purpose == DIR_PURPOSE_SERVER)
|
||||||
|
|
||||||
#define _CONTROL_CONN_STATE_MIN 1
|
#define _CONTROL_CONN_STATE_MIN 1
|
||||||
#define CONTROL_CONN_STATE_OPEN_V0 1
|
#define CONTROL_CONN_STATE_OPEN_V0 1
|
||||||
#define CONTROL_CONN_STATE_OPEN_V1 2
|
#define CONTROL_CONN_STATE_OPEN_V1 2
|
||||||
|
Loading…
Reference in New Issue
Block a user