diff --git a/src/algo_naive.c b/src/algo_naive.c index 9a2556e..d704fec 100644 --- a/src/algo_naive.c +++ b/src/algo_naive.c @@ -165,7 +165,6 @@ void on_tcp_read(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { // 3. A whole packet has been read, we will find someone to write it sprintf(url, "udp:write:127.0.0.1:%d", bp->ip.ap.str.port); - printf("wil be forwarded to: %s\n", url); to_fdinfo = evt_core_get_from_url (ctx, url); if (to_fdinfo == NULL) goto co_error; diff --git a/src/evt_core.c b/src/evt_core.c index b60f55e..f17ad4c 100644 --- a/src/evt_core.c +++ b/src/evt_core.c @@ -150,7 +150,14 @@ void evt_core_loop(struct evt_core_ctx* ctx) { int evt = events[n].events; if (evt & EPOLLRDHUP) fprintf(stderr, "Epoll Read Hup Event. "); if (evt & EPOLLHUP) fprintf(stderr, "Epoll Hup Event. "); - if (evt & EPOLLERR) fprintf(stderr, "Epoll Err Event. "); + if (evt & EPOLLERR) { + int error = 0; + socklen_t errlen = sizeof(error); + if (getsockopt(err_fd, SOL_SOCKET, SO_ERROR, (void *)&error, &errlen) == 0) { + printf("Socket %d error = %s\n", err_fd, strerror(error)); + } + fprintf(stderr, "Epoll Err Event. "); + } fdinfo = evt_core_get_from_fd(ctx, err_fd); if (fdinfo != NULL) {