From cfe830405f1c8a2858f3f6ba5dce3abc58a17d6e Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sat, 18 Mar 2017 16:14:03 +0800 Subject: [PATCH] Fix #1376 --- src/redir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/redir.c b/src/redir.c index 86958885..163a8c9b 100644 --- a/src/redir.c +++ b/src/redir.c @@ -453,6 +453,8 @@ remote_send_cb(EV_P_ ev_io *w, int revents) remote_t *remote = remote_send_ctx->remote; server_t *server = remote->server; + ev_timer_stop(EV_A_ & remote_send_ctx->watcher); + if (!remote_send_ctx->connected) { int r = 0; if (remote->addr == NULL) { @@ -465,7 +467,6 @@ remote_send_cb(EV_P_ ev_io *w, int revents) remote_send_ctx->connected = 1; ev_io_stop(EV_A_ & remote_send_ctx->io); ev_io_stop(EV_A_ & server->recv_ctx->io); - ev_timer_stop(EV_A_ & remote_send_ctx->watcher); ev_timer_start(EV_A_ & remote->recv_ctx->watcher); // send destaddr