Skip to content

Commit c18e4f0

Browse files
authored
Update call of curl_multi_wait in CurlMulti.cpp (#910)
1 parent 54172bf commit c18e4f0

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

Source/HTTP/Curl/CurlMulti.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ HRESULT CurlMulti::Perform() noexcept
257257
{
258258
// Reschedule Perform if there are still running requests
259259
int workAvailable{ 0 };
260+
#if HC_PLATFORM == HC_PLATFORM_GDK || CURL_AT_LEAST_VERSION(7,66,0)
260261
// Try curl_multi_poll first, fall back to curl_multi_wait if not available
261262
// For non-GDK, CURL_CALL expands directly to the symbol
262263
if (CURL_CALL(curl_multi_poll))
@@ -267,12 +268,9 @@ HRESULT CurlMulti::Perform() noexcept
267268
{
268269
result = CURL_CALL(curl_multi_wait)(m_curlMultiHandle, nullptr, 0, POLL_TIMEOUT_MS, &workAvailable);
269270
}
270-
271-
if (result != CURLM_OK)
272-
{
273-
HC_TRACE_ERROR(HTTPCLIENT, "CurlMulti::Perform: curl_multi_poll/wait failed with CURLCode=%u", result);
274-
return HrFromCurlm(result);
275-
}
271+
#else
272+
result = CURL_CALL(curl_multi_wait)(m_curlMultiHandle, nullptr, 0, POLL_TIMEOUT_MS, &workAvailable);
273+
#endif
276274

277275
uint32_t delay = workAvailable ? 0 : PERFORM_DELAY_MS;
278276
ScheduleTaskQueueCallback(std::move(lock), delay);

0 commit comments

Comments
 (0)