MCPcopy Create free account
hub / github.com/axmolengine/axmol / processResponse

Method processResponse

core/network/HttpClient.cpp:220–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220void HttpClient::processResponse(HttpResponse* response, int channelIndex)
221{
222 response->retain();
223
224 if (response->validateUri())
225 {
226 if (channelIndex == -1)
227 channelIndex = tryTakeAvailChannel();
228
229 if (channelIndex != -1)
230 {
231 auto channelHandle = _service->channel_at(channelIndex);
232 auto& requestUri = response->getRequestUri();
233 channelHandle->ud_.ptr = response;
234 _service->set_option(YOPT_C_REMOTE_ENDPOINT, channelIndex, requestUri.getHost().data(),
235 (int)requestUri.getPort());
236 if (requestUri.isSecure())
237 _service->open(channelIndex, YCK_SSL_CLIENT);
238 else
239 _service->open(channelIndex, YCK_TCP_CLIENT);
240 }
241 else
242 _pendingResponseQueue.emplace_back(response);
243 }
244 else
245 finishResponse(response);
246}
247
248void HttpClient::handleNetworkEvent(yasio::io_event* event)
249{

Callers

nothing calls this directly

Calls 6

channel_atMethod · 0.80
set_optionMethod · 0.80
retainMethod · 0.45
dataMethod · 0.45
openMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected