From b0fa16a7feed8ed979677cb6292ebf3c9324c180 Mon Sep 17 00:00:00 2001 From: Dengfeng Liu Date: Mon, 24 Apr 2017 15:03:23 +0800 Subject: [PATCH] Update tcp_proxy.c --- tcp_proxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcp_proxy.c b/tcp_proxy.c index b490b2b..887c98f 100644 --- a/tcp_proxy.c +++ b/tcp_proxy.c @@ -64,13 +64,13 @@ tcp_proxy_accept_cb(struct evconnlistener *listener, evutil_socket_t fd, { struct xkcp_proxy_param *p = param; struct bufferevent *b_in = NULL; - struct event_base *base = p->base; + struct event_base *base = evconnlistener_get_base(listener); b_in = bufferevent_socket_new(base, fd, BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS); assert(b_in); - debug(LOG_INFO, "accept new client in"); + debug(LOG_INFO, "accept new client in [%d]", fd); static int conv = 1; ikcpcb *kcp_client = ikcp_create(conv, param);