mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
dirmngr: Fix the regression of use of proxy for TLS connection.
* dirmngr/http.c (run_proxy_connect): Don't set keep_alive, since it causes resource leak of FP_WRITE. Don't try to read response body to fix the hang. -- GnuPG-bug-id: 6997 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
0370678536
commit
848546b05a
@ -2553,6 +2553,7 @@ run_proxy_connect (http_t hd, proxy_info_t proxy,
|
|||||||
* RFC-4559 - SPNEGO-based Kerberos and NTLM HTTP Authentication
|
* RFC-4559 - SPNEGO-based Kerberos and NTLM HTTP Authentication
|
||||||
*/
|
*/
|
||||||
auth_basic = !!proxy->uri->auth;
|
auth_basic = !!proxy->uri->auth;
|
||||||
|
hd->keep_alive = 0;
|
||||||
|
|
||||||
/* For basic authentication we need to send just one request. */
|
/* For basic authentication we need to send just one request. */
|
||||||
if (auth_basic
|
if (auth_basic
|
||||||
@ -2574,13 +2575,12 @@ run_proxy_connect (http_t hd, proxy_info_t proxy,
|
|||||||
httphost ? httphost : server,
|
httphost ? httphost : server,
|
||||||
port,
|
port,
|
||||||
authhdr ? authhdr : "",
|
authhdr ? authhdr : "",
|
||||||
auth_basic? "" : "Connection: keep-alive\r\n");
|
hd->keep_alive? "Connection: keep-alive\r\n" : "");
|
||||||
if (!request)
|
if (!request)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
hd->keep_alive = !auth_basic; /* We may need to send more requests. */
|
|
||||||
|
|
||||||
if (opt_debug || (hd->flags & HTTP_FLAG_LOG_RESP))
|
if (opt_debug || (hd->flags & HTTP_FLAG_LOG_RESP))
|
||||||
log_debug_string (request, "http.c:proxy:request:");
|
log_debug_string (request, "http.c:proxy:request:");
|
||||||
@ -2607,16 +2607,6 @@ run_proxy_connect (http_t hd, proxy_info_t proxy,
|
|||||||
if (err)
|
if (err)
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
{
|
|
||||||
unsigned long count = 0;
|
|
||||||
|
|
||||||
while (es_getc (hd->fp_read) != EOF)
|
|
||||||
count++;
|
|
||||||
if (opt_debug)
|
|
||||||
log_debug ("http.c:proxy_connect: skipped %lu bytes of response-body\n",
|
|
||||||
count);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Reset state. */
|
/* Reset state. */
|
||||||
es_clearerr (hd->fp_read);
|
es_clearerr (hd->fp_read);
|
||||||
((cookie_t)(hd->read_cookie))->up_to_empty_line = 1;
|
((cookie_t)(hd->read_cookie))->up_to_empty_line = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user