You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CURLMcode mc = curl_multi_perform(self->multi_handle_, &still_running);
360
361
361
-
std::chrono::milliseconds wait_for;
362
-
#if LIBCURL_VERSION_NUM >= 0x074200
363
-
// only avaliable with curl_multi_poll
364
-
wait_for = self->background_thread_wait_for_;
365
-
#endif
366
-
if (self->is_shutdown.load(std::memory_order_acquire))
367
-
{
368
-
wait_for = std::chrono::milliseconds{0};
369
-
}
370
-
371
362
// According to https://curl.se/libcurl/c/curl_multi_perform.html, when mc is not OK, we
372
363
// can not curl_multi_perform it again
373
364
if (mc != CURLM_OK)
374
365
{
375
366
self->resetMultiHandle();
376
367
}
377
-
elseif (still_running || now - last_free_job_timepoint < wait_for)
368
+
elseif (still_running || need_wait_more)
378
369
{
379
370
// curl_multi_poll is added from libcurl 7.66.0, before 7.68.0, we can only wait util
auto session = http_client->CreateSession("http://127.0.0.1:19000/get/");
536
+
auto request = session->CreateRequest();
537
+
request->SetUri("get/");
538
+
auto handler = std::make_shared<GetEventHandler>();
539
+
session->SendRequest(handler);
540
+
http_client->FinishAllSessions();
541
+
http_client.reset();
542
+
// when use background_thread_wait_for_ should have no side effort on elegant quit
543
+
ASSERT_TRUE(std::chrono::system_clock::now() - beg < std::chrono::milliseconds{5});
0 commit comments