From a772aba1f481e7bd39b70ebbe9db737155f6ca12 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Mon, 22 Dec 2014 11:58:21 +0800 Subject: [PATCH] refine log --- src/local.c | 4 +++- src/redir.c | 2 -- src/server.c | 4 +++- src/tunnel.c | 4 +++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/local.c b/src/local.c index 5a8a0378..0bde9f50 100644 --- a/src/local.c +++ b/src/local.c @@ -541,7 +541,9 @@ static void remote_timeout_cb(EV_P_ ev_timer *watcher, int revents) struct remote *remote = remote_ctx->remote; struct server *server = remote->server; - LOGD("remote timeout"); + if (verbose) { + LOGD("TCP connection timeout"); + } close_and_free_remote(EV_A_ remote); close_and_free_server(EV_A_ server); diff --git a/src/redir.c b/src/redir.c index 08effbf7..24d450fe 100644 --- a/src/redir.c +++ b/src/redir.c @@ -270,8 +270,6 @@ static void remote_timeout_cb(EV_P_ ev_timer *watcher, int revents) struct remote *remote = remote_ctx->remote; struct server *server = remote->server; - LOGD("remote timeout"); - ev_timer_stop(EV_A_ watcher); if (server == NULL) { diff --git a/src/server.c b/src/server.c index 0014316e..21ab1b99 100644 --- a/src/server.c +++ b/src/server.c @@ -499,7 +499,9 @@ static void server_timeout_cb(EV_P_ ev_timer *watcher, int revents) struct server *server = server_ctx->server; struct remote *remote = server->remote; - LOGE("TCP connection timeout"); + if (verbose) { + LOGD("TCP connection timeout"); + } close_and_free_remote(EV_A_ remote); close_and_free_server(EV_A_ server); diff --git a/src/tunnel.c b/src/tunnel.c index 7769bba8..3a0d8597 100644 --- a/src/tunnel.c +++ b/src/tunnel.c @@ -275,7 +275,9 @@ static void remote_timeout_cb(EV_P_ ev_timer *watcher, int revents) struct remote *remote = remote_ctx->remote; struct server *server = remote->server; - LOGD("remote timeout"); + if (verbose) { + LOGD("TCP connection timeout"); + } ev_timer_stop(EV_A_ watcher);