-
- this_timeout = ZOOM_options_get_int (c->options, "timeout", -1);
- if (this_timeout != -1 && this_timeout < timeout)
- timeout = this_timeout;
+
+ /* -1 is used for indefinite timeout (no timeout), so -2 here. */
+ this_timeout = ZOOM_options_get_int (c->options, "timeout", -2);
+ if (this_timeout != -2)
+ {
+ /* ensure the minimum timeout is used */
+ if (!timeout_set)
+ timeout = this_timeout;
+ else if (this_timeout != -1 && this_timeout < timeout)
+ timeout = this_timeout;
+ timeout_set = 1;
+ }