aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/http.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-07-26 11:48:27 +0000
committerWerner Koch <[email protected]>2017-07-26 11:48:27 +0000
commitc5e5748480952e5bcedb16f6ce6ef7e435acb3c7 (patch)
tree8fb8f9486c5bdedf524a1885cba7940efdcf127b /dirmngr/http.c
parentdirmngr: Auto-enable Tor on startup or reload. (diff)
downloadgnupg-c5e5748480952e5bcedb16f6ce6ef7e435acb3c7.tar.gz
gnupg-c5e5748480952e5bcedb16f6ce6ef7e435acb3c7.zip
dirmngr: Do not use a blocking connect in Tor mode.
* dirmngr/http.c (http_raw_connect): Disable the timeout in Tor mode. (send_request): Ditto. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--dirmngr/http.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dirmngr/http.c b/dirmngr/http.c
index 63ed5d34c..0bedba098 100644
--- a/dirmngr/http.c
+++ b/dirmngr/http.c
@@ -955,6 +955,10 @@ http_raw_connect (http_t *r_hd, const char *server, unsigned short port,
log_error ("Tor support is not available\n");
return gpg_err_make (default_errsource, GPG_ERR_NOT_IMPLEMENTED);
}
+ /* Non-blocking connects do not work with our Tor proxy because
+ * we can't continue the Socks protocol after the EINPROGRESS.
+ * Disable the timeout to use a blocking connect. */
+ timeout = 0;
}
/* Create the handle. */
@@ -1698,6 +1702,10 @@ send_request (http_t hd, const char *httphost, const char *auth,
log_error ("Tor support is not available\n");
return gpg_err_make (default_errsource, GPG_ERR_NOT_IMPLEMENTED);
}
+ /* Non-blocking connects do not work with our Tor proxy because
+ * we can't continue the Socks protocol after the EINPROGRESS.
+ * Disable the timeout to use a blocking connect. */
+ timeout = 0;
}
server = *hd->uri->host ? hd->uri->host : "localhost";