pong handler: add sanity check for rtt
This commit is contained in:
parent
7b220b1464
commit
8f21a5da81
1 changed files with 6 additions and 0 deletions
|
@ -137,6 +137,12 @@ bool pong_h(connection_t *c, const char *request) {
|
||||||
tv_usec = c->last_ping_time.tv_usec;
|
tv_usec = c->last_ping_time.tv_usec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_now.tv_sec - tv_sec > 2*pingtimeout) {
|
||||||
|
/* timeout_handler should close the meta connection after pingtimeout.
|
||||||
|
* So if we still receive such pong, something is fishy. */
|
||||||
|
logger(DEBUG_ALWAYS, LOG_ERR, "bogus pong received from %s (%s)", c->name, c->hostname);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
/* RTT should be in ms */
|
/* RTT should be in ms */
|
||||||
current_rtt = (_now.tv_sec - tv_sec)*1000;
|
current_rtt = (_now.tv_sec - tv_sec)*1000;
|
||||||
/* Compute diff between usec */
|
/* Compute diff between usec */
|
||||||
|
|
Loading…
Reference in a new issue