From 745cc2c0b031dc8a821ac6a4f47cd21db152f86d Mon Sep 17 00:00:00 2001 From: halx99 Date: Sun, 5 Sep 2021 22:19:19 +0800 Subject: [PATCH] Sync yasio --- thirdparty/yasio/yasio.cpp | 7 ++++--- thirdparty/yasio/yasio.hpp | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/thirdparty/yasio/yasio.cpp b/thirdparty/yasio/yasio.cpp index 6c6bea10e4..94b4c8e1ee 100644 --- a/thirdparty/yasio/yasio.cpp +++ b/thirdparty/yasio/yasio.cpp @@ -67,6 +67,7 @@ SOFTWARE. #define YASIO_KLOGD(format, ...) YASIO_KLOG_CP(YLOG_D, format, ##__VA_ARGS__) #define YASIO_KLOGI(format, ...) YASIO_KLOG_CP(YLOG_I, format, ##__VA_ARGS__) +#define YASIO_KLOGW(format, ...) YASIO_KLOG_CP(YLOG_W, format, ##__VA_ARGS__) #define YASIO_KLOGE(format, ...) YASIO_KLOG_CP(YLOG_E, format, ##__VA_ARGS__) #if !defined(YASIO_VERBOSE_LOG) @@ -650,7 +651,7 @@ void io_transport_udp::set_primitives() { auto error = xxsocket::get_last_errno(); if (!xxsocket::not_send_error(error)) - YASIO_KLOGI("[index: %d] write udp socket failed, ec=%d, detail:%s", this->cindex(), error, io_service::strerror(error)); + YASIO_KLOGW("[index: %d] write udp socket failed, ec=%d, detail:%s", this->cindex(), error, io_service::strerror(error)); } return n; }; @@ -935,7 +936,7 @@ void io_service::run() if (retval < 0) { int ec = xxsocket::get_last_errno(); - YASIO_KLOGD("[core] do_select failed, ec=%d, detail:%s\n", ec, io_service::strerror(ec)); + YASIO_KLOGI("[core] do_select failed, ec=%d, detail:%s\n", ec, io_service::strerror(ec)); if (ec != EBADF) continue; // Try again. goto _L_end; @@ -1546,7 +1547,7 @@ void io_service::config_ares_name_servers() { status = ::ares_set_servers_csv(ares_, YASIO_CARES_FALLBACK_DNS); if (status == 0) - YASIO_KLOGD("[c-ares] set fallback dns: '%s' succeed", YASIO_CARES_FALLBACK_DNS); + YASIO_KLOGW("[c-ares] set fallback dns: '%s' succeed", YASIO_CARES_FALLBACK_DNS); else YASIO_KLOGE("[c-ares] set fallback dns: '%s' failed, detail: %s", YASIO_CARES_FALLBACK_DNS, ::ares_strerror(status)); } diff --git a/thirdparty/yasio/yasio.hpp b/thirdparty/yasio/yasio.hpp index 152d9c27dd..82160fc887 100644 --- a/thirdparty/yasio/yasio.hpp +++ b/thirdparty/yasio/yasio.hpp @@ -296,6 +296,7 @@ enum YLOG_V, YLOG_D, YLOG_I, + YLOG_W, YLOG_E, };