0001-connectivity-make-curl-timeout-callback-non-repeating.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From abc6e1cf258ab332bed161036a358bbe9c2d1e90 Mon Sep 17 00:00:00 2001
  2. From: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
  3. Date: Fri, 13 Oct 2023 16:46:09 +0000
  4. Subject: [PATCH] connectivity: Make curl timeout callback non-repeating.
  5. This reverts commit 05c31da4d9.
  6. In the linked commit the callback was made repeating on the assumption
  7. that forward progress would result in the callback getting canceled in
  8. cb_data_complete. However, this assumption does not hold since a timeout
  9. callback does not guarantee completion (or error out) of a request.
  10. curl tweaked some internals in v8.4.0 and started giving 0 timeouts, and
  11. a repeating callback is firing back-to-back without making any progress
  12. in doing so.
  13. Revert the change and make the callback non-repeating again.
  14. Fixes: 05c31da4d9cb ('connectivity: don't cancel curl timerfunction from timeout')
  15. Upstream: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/abc6e1cf258ab332bed161036a358bbe9c2d1e90
  16. Signed-off-by: Christian Hitz <christian.hitz@bbv.ch>
  17. ---
  18. src/core/nm-connectivity.c | 3 ++-
  19. 1 file changed, 2 insertions(+), 1 deletion(-)
  20. diff --git a/src/core/nm-connectivity.c b/src/core/nm-connectivity.c
  21. index 92de44f17d..d8b0004c38 100644
  22. --- a/src/core/nm-connectivity.c
  23. +++ b/src/core/nm-connectivity.c
  24. @@ -406,9 +406,10 @@ _con_curl_timeout_cb(gpointer user_data)
  25. {
  26. NMConnectivityCheckHandle *cb_data = user_data;
  27. + cb_data->concheck.curl_timer = 0;
  28. _con_curl_check_connectivity(cb_data->concheck.curl_mhandle, CURL_SOCKET_TIMEOUT, 0);
  29. _complete_queued(cb_data->self);
  30. - return G_SOURCE_CONTINUE;
  31. + return G_SOURCE_REMOVE;
  32. }
  33. static int
  34. --
  35. GitLab