From 30f20e6e6b1c822ab925eadfccd9832986050e4c Mon Sep 17 00:00:00 2001 From: zfl9 Date: Sat, 7 Mar 2020 10:32:24 +0800 Subject: use libev instead of libuv --- dnsudp2tcp.c | 16 ++++++++-------- test | Bin 77424 -> 77424 bytes 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dnsudp2tcp.c b/dnsudp2tcp.c index e175666..8225db7 100644 --- a/dnsudp2tcp.c +++ b/dnsudp2tcp.c @@ -98,53 +98,53 @@ static void tcp_recvmsg_cb(evloop_t *evloop, evio_t *watcher, int events); static void set_nonblock(int sockfd) { int flags = fcntl(sockfd, F_GETFL, 0); if (flags < 0) { - LOGERR("[set_nonblock] fcntl(%d, F_GETFL) failed: (%d) %s", sockfd, errno, strerror(errno)); + LOGERR("[set_nonblock] fcntl(%d, F_GETFL): (%d) %s", sockfd, errno, strerror(errno)); exit(errno); } if (fcntl(sockfd, F_SETFL, flags | O_NONBLOCK) < 0) { - LOGERR("[set_nonblock] fcntl(%d, F_SETFL) failed: (%d) %s", sockfd, errno, strerror(errno)); + LOGERR("[set_nonblock] fcntl(%d, F_SETFL): (%d) %s", sockfd, errno, strerror(errno)); exit(errno); } } static void set_ipv6only(int sockfd) { if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, &(int){1}, sizeof(int)) < 0) { - LOGERR("[set_ipv6only] setsockopt(%d, IPV6_V6ONLY) failed: (%d) %s", sockfd, errno, strerror(errno)); + LOGERR("[set_ipv6only] setsockopt(%d, IPV6_V6ONLY): (%d) %s", sockfd, errno, strerror(errno)); exit(errno); } } static void set_reuseaddr(int sockfd) { if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int)) < 0) { - LOGERR("[set_reuseaddr] setsockopt(%d, SO_REUSEADDR) failed: (%d) %s", sockfd, errno, strerror(errno)); + LOGERR("[set_reuseaddr] setsockopt(%d, SO_REUSEADDR): (%d) %s", sockfd, errno, strerror(errno)); exit(errno); } } static void set_reuseport(int sockfd) { if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT, &(int){1}, sizeof(int)) < 0) { - LOGERR("[set_reuseport] setsockopt(%d, SO_REUSEPORT) failed: (%d) %s", sockfd, errno, strerror(errno)); + LOGERR("[set_reuseport] setsockopt(%d, SO_REUSEPORT): (%d) %s", sockfd, errno, strerror(errno)); exit(errno); } } static void set_nodelay(int sockfd) { if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &(int){1}, sizeof(int)) < 0) { - LOGERR("[set_nodelay] setsockopt(%d, TCP_NODELAY) failed: (%d) %s", sockfd, errno, strerror(errno)); + LOGERR("[set_nodelay] setsockopt(%d, TCP_NODELAY): (%d) %s", sockfd, errno, strerror(errno)); exit(errno); } } static void set_quickack(int sockfd) { if (setsockopt(sockfd, IPPROTO_TCP, TCP_QUICKACK, &(int){1}, sizeof(int)) < 0) { - LOGERR("[set_quickack] setsockopt(%d, TCP_QUICKACK) failed: (%d) %s", sockfd, errno, strerror(errno)); + LOGERR("[set_quickack] setsockopt(%d, TCP_QUICKACK): (%d) %s", sockfd, errno, strerror(errno)); exit(errno); } } static void set_syncnt(int sockfd, int syncnt) { if (setsockopt(sockfd, IPPROTO_TCP, TCP_SYNCNT, &syncnt, sizeof(syncnt)) < 0) { - LOGERR("[set_syncnt] setsockopt(%d, TCP_SYNCNT) failed: (%d) %s", sockfd, errno, strerror(errno)); + LOGERR("[set_syncnt] setsockopt(%d, TCP_SYNCNT): (%d) %s", sockfd, errno, strerror(errno)); exit(errno); } } diff --git a/test b/test index 88f17ff..3657881 100755 Binary files a/test and b/test differ -- cgit v1.2.3