Skip to content

Commit

Permalink
Fix bug: Logical error for timeout check
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
  • Loading branch information
Jianhui Zhao committed Jan 19, 2019
1 parent eaacc64 commit 77572be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/uwsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,10 @@ static void uwsc_timer_cb(struct ev_loop *loop, struct ev_timer *w, int revents)
return;

if (unlikely(cl->wait_pong)) {
if (now - cl->last_ping < 3)
if (now - cl->last_ping < 5)
return;

cl->wait_pong = false;
uwsc_log_err("ping timeout %d\n", ++cl->ntimeout);
if (cl->ntimeout > 2) {
uwsc_error(cl, UWSC_ERROR_PING_TIMEOUT, "ping timeout");
Expand Down

0 comments on commit 77572be

Please sign in to comment.