Skip to content

Commit

Permalink
not send_traffic_stat under tunnel mode
Browse files Browse the repository at this point in the history
  • Loading branch information
breakwa11 committed May 16, 2017
1 parent e989bbb commit be6114d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/udprelay.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ static void close_and_free_remote(EV_P_ remote_ctx_t *ctx);
static remote_ctx_t *new_remote(int fd, server_ctx_t *server_ctx);

#ifdef ANDROID
extern int log_tx_rx;
extern uint64_t tx;
extern uint64_t rx;
extern int vpn;
Expand Down Expand Up @@ -762,7 +763,7 @@ remote_recv_cb(EV_P_ ev_io *w, int revents)
memmove(buf->array, buf->array + len, buf->len);
#else
#ifdef ANDROID
if (r > 0)
if (r > 0 && log_tx_rx)
rx += r;
#endif
// Construct packet
Expand Down Expand Up @@ -1234,7 +1235,8 @@ server_recv_cb(EV_P_ ev_io *w, int revents)
}
#if !defined(MODULE_TUNNEL) && !defined(MODULE_REDIR)
#ifdef ANDROID
tx += buf->len;
if (log_tx_rx)
tx += buf->len;
#endif
#endif

Expand Down

0 comments on commit be6114d

Please sign in to comment.