Changed ping behaviour (backwards compatible). If we don't have any data

to send, we don't need to check if the connection is still alive.
Furthermore, if we receive any kind of data from the other end, we know
it's alive, so we don't need to check it either. So, PING requests are
only sent if we send packets but there is no response.
This commit is contained in:
Guus Sliepen 2000-05-14 13:02:20 +00:00
parent ee96ccabbb
commit e20e143f1e
2 changed files with 43 additions and 43 deletions

View file

@ -115,6 +115,8 @@ typedef struct conn_list_t {
char buffer[MAXBUFSIZE+1]; /* metadata input buffer */
int buflen; /* bytes read into buffer */
int reqlen; /* length of first request in buffer */
time_t last_ping_time; /* last time we saw some activity from the other end */
int want_ping; /* 0 if there's no need to check for activity */
struct conn_list_t *nexthop; /* nearest meta-hop in this direction */
struct conn_list_t *next; /* after all, it's a list of connections */
} conn_list_t;