[OpenSIPS-Devel] [OpenSIPS/opensips] a45d39: [rest_client] Fix async connection logic

Liviu Chircu noreply at github.com
Mon Apr 26 11:03:05 EST 2021


  Branch: refs/heads/2.4
  Home:   https://github.com/OpenSIPS/opensips
  Commit: a45d391594f0521056dee6f56df9779894ea0dab
      https://github.com/OpenSIPS/opensips/commit/a45d391594f0521056dee6f56df9779894ea0dab
  Author: John Burke <john at voxtelesys.net>
  Date:   2021-04-26 (Mon, 26 Apr 2021)

  Changed paths:
    M modules/rest_client/rest_methods.c

  Log Message:
  -----------
  [rest_client] Fix async connection logic

Fixes #2483

(cherry picked from commit 98c6652a08869f5eb82295c9e6b8a419a8e1b128)


  Commit: f9c28aac8748553bc677a63e965f1f8b909a265a
      https://github.com/OpenSIPS/opensips/commit/f9c28aac8748553bc677a63e965f1f8b909a265a
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2021-04-26 (Mon, 26 Apr 2021)

  Changed paths:
    M modules/rest_client/rest_methods.c

  Log Message:
  -----------
  rest_client: Fix async rest_get() stalling with local web server

Similar issue to #2483, where the async GET operation would stall
indefinitely, due to curl_multi_perform() not being called multiple
times during the single invocation of the "resume" callback.

In this case, the issue was caused by a misplaced "enable_expect_100"
check.  Not using the "Expect: 100" feature doesn't mean that
curl_multi_perform() should be called at most once.

Using libcurl 7.68

(cherry picked from commit fc88b2c99238c85c53fabf363b5ba1393d54c10d)


  Commit: 2a58814cfbdbabc4691718fdfa58af2112e92f68
      https://github.com/OpenSIPS/opensips/commit/2a58814cfbdbabc4691718fdfa58af2112e92f68
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2021-04-26 (Mon, 26 Apr 2021)

  Changed paths:
    M io_wait.h

  Log Message:
  -----------
  io_watch_del(): Suppress DEL errors for closed fds

Similar fix to 21344d1f7 (from 6 years ago), but for newer Linux kernels
(e.g. 5.8.0), which return ENOENT instead of EBADF.  Fixes:

DBG:rest_client:_resume_async_http_req: HTTP response code: 200
DBG:tm:io_watch_del: [UDP_worker] io_watch_del op on index -1 246
    (0x561edd52c560, 246, -1, 0x10,0x1) fd_no=5 called
ERROR:tm:io_watch_del: [UDP_worker] removing fd from epoll
    (246 from 171) list failed: No such file or directory [2]
(cherry picked from commit 4e43db731a5500163141607d9400e42a74d2f293)


Compare: https://github.com/OpenSIPS/opensips/compare/b76178639573...2a58814cfbdb



More information about the Devel mailing list