@nchaigne commented on this pull request.


> @@ -187,15 +187,35 @@ modparam("http_client", "maxdatasize", 2000)
                        </para>
                        <para>
                        <emphasis>
-                               Default value is zero, i.e.,
-                               the timeout function is disabled.
+                               Default value is 4.


Current behaviour is messy and confusing. Depending on the order of 
declarations in configuration, the actual behaviour changes.
I propose to add parameter "timeout_mode" as suggested by Daniel, and rework 
the timeout behaviour as described hereafter.


A curl timeout will always be set. It makes no sense to allow to block forever, 
and it's dangerous.
If need be, user can configure a very large timeout.

```
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):
    if timeout_mode == 0 -> global timeout = 4 (seconds)
    else -> global timeout = 4000 (milliseconds)

  for each connection "conn":
    if conn.timeout is configured, keep its value.
    else: conn.timeout = global timeout (in seconds or milliseconds, depending 
on timeout_mode).

When doing Curl requests (curL_request_url):
  if timeout_mode == 0: set CURLOPT_TIMEOUT
  else: set CURLOPT_TIMEOUT_MS
```

Let me know what you think.
I you agree, I will do a pull request with this proposal.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3611#discussion_r1368443380
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/3611/review/1692191...@github.com>
_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to