Forward packet for HttpClient only (#1164)

This commit is contained in:
Deal(涓€绾跨伒) 2023-04-03 22:32:33 +08:00 committed by GitHub
parent 2f1a4a9921
commit 0451318aaa
1 changed files with 2 additions and 2 deletions

View File

@ -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())