diff options
author | Werner Koch <[email protected]> | 2017-06-08 07:30:48 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-06-08 07:37:36 +0000 |
commit | 9b43220b8ad1a5c1cd51de3bbfff7ccbcc3fa877 (patch) | |
tree | 6ef342f715e143c390eff68629d909e94f6cbd6f /dirmngr/dirmngr.h | |
parent | dirmngr: Allow a timeout for HTTP and other TCP connects. (diff) | |
download | gnupg-9b43220b8ad1a5c1cd51de3bbfff7ccbcc3fa877.tar.gz gnupg-9b43220b8ad1a5c1cd51de3bbfff7ccbcc3fa877.zip |
dirmngr: Implement HTTP connect timeouts of 15 or 2 seconds.
* dirmngr/dirmngr.c (oConnectTimeout, oConnectQuickTimeout): New
enums.
(opts): New options --connect-timeout and --connect-quick-timeout.
(DEFAULT_CONNECT_TIMEOUT): New.
(DEFAULT_CONNECT_QUICK_TIMEOUT): New.
(parse_rereadable_options): Handle new options.
(post_option_parsing): New. Use instead of direct calls to
set_debug() and set_tor_mode ().
(main): Setup default timeouts.
(dirmngr_init_default_ctrl): Set standard connect timeout.
* dirmngr/dirmngr.h (opt): New fields connect_timeout and
connect_quick_timeout.
(server_control_s): New field timeout.
* dirmngr/ks-engine-finger.c (ks_finger_fetch): Pass timeout to
http_raw_connect.
* dirmngr/ks-engine-hkp.c (send_request): Call
http_session_set_timeout.
* dirmngr/ks-engine-http.c (ks_http_fetch): Ditto.
* dirmngr/server.c (cmd_wkd_get, cmd_ks_search, cmd_ks_get)
(cmd_ks_fetch): Implement --quick option.
--
The standard connect timeouts are way to long so we add a timeout to
the connect calls. Also implement the --quick option which is already
used by gpg for non-important requests (e.g. looking up a key for
verification).
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/dirmngr.h')
-rw-r--r-- | dirmngr/dirmngr.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dirmngr/dirmngr.h b/dirmngr/dirmngr.h index e10de09c1..0f5dde28e 100644 --- a/dirmngr/dirmngr.h +++ b/dirmngr/dirmngr.h @@ -95,6 +95,10 @@ struct int force; /* Force loading outdated CRLs. */ + + unsigned int connect_timeout; /* Timeout for connect. */ + unsigned int connect_quick_timeout; /* Shorter timeout for connect. */ + int disable_http; /* Do not use HTTP at all. */ int disable_ldap; /* Do not use LDAP at all. */ int disable_ipv4; /* Do not use legacy IP addresses. */ @@ -194,6 +198,8 @@ struct server_control_s int audit_events; /* Send audit events to client. */ char *http_proxy; /* The used http_proxy or NULL. */ + unsigned int timeout; /* Timeout for connect calls in ms. */ + unsigned int http_no_crl:1; /* Do not check CRLs for https. */ }; |