aports/community/net-cpp/0001-curl-multi-handle-timer_callback-correctly.patch
Luca Weiss cdee8cba85 community/net-cpp: fix issues with new libcurl
We can also re-enable tests now.

Also increase the timeout to start httpbin from 5 seconds to 10 seconds
because apparently 5 is not enough for s390x on GitLab.

Fixes alpine/aports#13719
2022-06-18 15:46:19 +02:00

36 lines
1.0 KiB
Diff

From 211abf28ea6ff067776caacf97287e97ab21acac Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 18 Jun 2022 11:33:51 +0200
Subject: [PATCH 1/2] curl/multi: handle timer_callback correctly
As per libcurl documentation:
> A timeout_ms value of -1 passed to this callback means you should
> delete the timer. All other values are valid expire times in number of
> milliseconds.
Adjust the code to match this.
---
src/core/net/http/impl/curl/multi.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/core/net/http/impl/curl/multi.cpp b/src/core/net/http/impl/curl/multi.cpp
index fd7d534..acfa8a1 100644
--- a/src/core/net/http/impl/curl/multi.cpp
+++ b/src/core/net/http/impl/curl/multi.cpp
@@ -428,8 +428,9 @@ int multi::Handle::Private::timer_callback(
long timeout_ms,
void* cookie)
{
- if (timeout_ms < 0)
- return -1;
+ /* -1 means we should just delete our timer. */
+ if (timeout_ms == -1)
+ return 0;
auto holder = static_cast<Private::Holder*>(cookie);
--
2.36.1