From 0451318aaaa45641df483be99448b0c0c382c170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deal=28=E6=B6=93=E2=82=AC=E7=BB=BE=E8=B7=A8=E4=BC=92=29?= Date: Mon, 3 Apr 2023 22:32:33 +0800 Subject: [PATCH] Forward packet for HttpClient only (#1164) --- core/network/HttpClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/network/HttpClient.cpp b/core/network/HttpClient.cpp index 0cd6b57bea..0dfd58bdd3 100644 --- a/core/network/HttpClient.cpp +++ b/core/network/HttpClient.cpp @@ -123,7 +123,7 @@ HttpClient::HttpClient() _scheduler = Director::getInstance()->getScheduler(); _service = new yasio::io_service(HttpClient::MAX_CHANNELS); - _service->set_option(yasio::YOPT_S_DEFERRED_EVENT, 1); + _service->set_option(yasio::YOPT_S_FORWARD_PACKET, 1); _service->set_option(yasio::YOPT_S_DNS_QUERIES_TIMEOUT, 3); _service->set_option(yasio::YOPT_S_DNS_QUERIES_TRIES, 1); _service->start([this](yasio::event_ptr&& e) { handleNetworkEvent(e.get()); }); @@ -263,7 +263,7 @@ void HttpClient::handleNetworkEvent(yasio::io_event* event) case YEK_ON_PACKET: if (!responseFinished) { - auto&& pkt = event->packet(); + auto&& pkt = event->packet_view(); response->handleInput(pkt.data(), pkt.size()); } if (response->isFinished())