mirror of https://github.com/axmolengine/axmol.git
Forward packet for HttpClient only (#1164)
This commit is contained in:
parent
2f1a4a9921
commit
0451318aaa
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue