| 893 | } |
| 894 | |
| 895 | void HttpClient::sendImmediate(HttpRequest *request) { |
| 896 | if (nullptr == request) { |
| 897 | return; |
| 898 | } |
| 899 | |
| 900 | request->addRef(); |
| 901 | // Create a HttpResponse object, the default setting is http access failed |
| 902 | auto *response = ccnew HttpResponse(request); |
| 903 | response->addRef(); // NOTE: RefCounted object's reference count is changed to 0 now. so needs to addRef after ccnew. |
| 904 | |
| 905 | gThreadPool->pushTask([this, request, response](int /*tid*/) { HttpClient::networkThreadAlone(request, response); }); |
| 906 | } |
| 907 | |
| 908 | // Poll and notify main thread if responses exists in queue |
| 909 | void HttpClient::dispatchResponseCallbacks() { |
nothing calls this directly
no test coverage detected