Module: kamailio
Branch: master
Commit: b882db36bbb7f7f13366bcc8f1db9f50910d2c0c
URL:
https://github.com/kamailio/kamailio/commit/b882db36bbb7f7f13366bcc8f1db9f5…
Author: Nicolas C <nchaigne(a)capgemini.fr>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-10-24T20:36:39+02:00
http_client: Add parameter timeout_mode (timeout in seconds or milliseconds)
A new parameter timeout_mode is added.
This parameter defines if timeouts are enabled, and in which unit timeout values are
expressed.
- 0 - Timeouts are disabled.
- 1 - Timeout values are in seconds (default).
- 2 - Timeout values are in milliseconds.
Implementation detail:
default global timeout = 0 (unconfigured).
Parse connections as usual. If they have a timeout configured, use it.
In mod_init:
if global timeout == 0 (unconfigured), and timeout_mode is 1 or 2:
if timeout_mode == 1 -> global timeout = 4 (seconds)
if timeout_mode == 2 -> global timeout = 4000 (milliseconds)
for each connection "conn" (fixup):
if timeout_mode is not 1 or 2 -> conn.timeout = 0 (to reflect the fact that no
timeout will be handled)
else if conn.timeout is not configured -> conn.timeout = global timeout (in seconds
or milliseconds, depending on timeout_mode).
When doing Curl requests (curL_request_url):
if timeout_mode == 1: set CURLOPT_TIMEOUT
if timeout_mode == 2: set CURLOPT_TIMEOUT_MS
---
Modified: src/modules/http_client/curlcon.c
Modified: src/modules/http_client/curlcon.h
Modified: src/modules/http_client/doc/http_client_admin.xml
Modified: src/modules/http_client/functions.c
Modified: src/modules/http_client/http_client.c
Modified: src/modules/http_client/http_client.h
---
Diff:
https://github.com/kamailio/kamailio/commit/b882db36bbb7f7f13366bcc8f1db9f5…
Patch:
https://github.com/kamailio/kamailio/commit/b882db36bbb7f7f13366bcc8f1db9f5…