mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Fix issue 1446: honor ports given in SRV responses.
* common/http.c (send_request, connect_server, http_open): Use a
struct srv instead of a single srvtag so we can pass the chosen host
and port back to the caller.
(connect_server): Use the proper port in the HAVE_GETADDRINFO case.
* keyserver/curl-shim.c (curl_easy_perform): Use struct srv and log
chosen host and port.
* keyserver/gpgkeys_hkp.c (main): Properly take the port given by SRV.
Backported from ba9e974f1f
This commit is contained in:
parent
3a51d501b9
commit
f2f12f41ef
4 changed files with 74 additions and 35 deletions
|
@ -1,6 +1,6 @@
|
|||
/* http.h - HTTP protocol handler
|
||||
* Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005,
|
||||
* 2009 Free Software Foundation, Inc.
|
||||
* 2009, 2012 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
|
@ -73,14 +73,21 @@ struct http_context {
|
|||
};
|
||||
typedef struct http_context *HTTP_HD;
|
||||
|
||||
struct http_srv
|
||||
{
|
||||
const char *srvtag;
|
||||
char *used_server;
|
||||
unsigned short used_port;
|
||||
};
|
||||
|
||||
int http_open( HTTP_HD hd, HTTP_REQ_TYPE reqtype, const char *url,
|
||||
char *auth, unsigned int flags, const char *proxy,
|
||||
const char *srvtag, STRLIST headers );
|
||||
struct http_srv *srv, STRLIST headers );
|
||||
void http_start_data( HTTP_HD hd );
|
||||
int http_wait_response( HTTP_HD hd, unsigned int *ret_status );
|
||||
void http_close( HTTP_HD hd );
|
||||
int http_open_document( HTTP_HD hd, const char *document, char *auth,
|
||||
unsigned int flags, const char *proxy,
|
||||
const char *srvtag, STRLIST headers );
|
||||
struct http_srv *srv, STRLIST headers );
|
||||
|
||||
#endif /*G10_HTTP_H*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue