@miconda 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.
I am for adding `timeout_mode`, seems cleaner to understand, imo. The only thing on your proposal that breaks the existing functionality is the ability to disable the timeout. I agree that there should be a timeout by default and I cannot think of a use case for disabling it (maybe when it is sure the http service is available(?!?) and not setting it saves some cpu/timer cycles), so I would propose the following:
- if timeout_mode is 0, then no timeout is set (disabled) - if timeout_mode is 1, then timeout value is in seconds and if connection_timeout is not set, then it is set to 4 (default), setting CURLOPT_TIMEOUT - if timeout_mode is 2, then timeout value is in milliseconds and if connection_timeout is not set, then it is set to 4000, setting CURLOPT_TIMEOUT_MS