diff options
author | zfl9 <zfl9.com@gmail.com> | 2020-03-07 10:32:24 +0800 |
---|---|---|
committer | zfl9 <zfl9.com@gmail.com> | 2020-03-07 10:32:24 +0800 |
commit | 30f20e6e6b1c822ab925eadfccd9832986050e4c (patch) | |
tree | f8d10aa0d77350151855ae4fa1a1ff84e25deb53 | |
parent | use libev instead of libuv (diff) | |
download | dns2tcp-30f20e6e6b1c822ab925eadfccd9832986050e4c.tar.gz dns2tcp-30f20e6e6b1c822ab925eadfccd9832986050e4c.tar.bz2 dns2tcp-30f20e6e6b1c822ab925eadfccd9832986050e4c.zip |
use libev instead of libuv
-rw-r--r-- | dnsudp2tcp.c | 16 | ||||
-rwxr-xr-x | 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); } } Binary files differ |