pong handler: add warning if we receive pong without ping
This commit is contained in:
parent
8f21a5da81
commit
25317983c7
1 changed files with 6 additions and 0 deletions
|
@ -126,6 +126,12 @@ bool pong_h(connection_t *c, const char *request) {
|
||||||
int current_rtt = 0;
|
int current_rtt = 0;
|
||||||
int tv_sec, tv_usec, ret;
|
int tv_sec, tv_usec, ret;
|
||||||
struct timeval _now;
|
struct timeval _now;
|
||||||
|
|
||||||
|
if (!c->status.pinged) {
|
||||||
|
logger(DEBUG_ALWAYS, LOG_WARNING, "received pong without ping");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
c->status.pinged = false;
|
c->status.pinged = false;
|
||||||
|
|
||||||
ret = sscanf(request, "%*d %d %d", &tv_sec, &tv_usec);
|
ret = sscanf(request, "%*d %d %d", &tv_sec, &tv_usec);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue