mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Fixed indentation and indented cpp directives
--
This commit is contained in:
parent
d23ec86095
commit
20c95ef258
2 changed files with 62 additions and 58 deletions
|
@ -150,7 +150,7 @@ static es_cookie_io_functions_t cookie_functions =
|
||||||
cookie_close
|
cookie_close
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cookie_s
|
struct cookie_s
|
||||||
{
|
{
|
||||||
int fd; /* File descriptor or -1 if already closed. */
|
int fd; /* File descriptor or -1 if already closed. */
|
||||||
gnutls_session_t tls_session; /* TLS session context or NULL if not used. */
|
gnutls_session_t tls_session; /* TLS session context or NULL if not used. */
|
||||||
|
@ -176,7 +176,7 @@ typedef struct header_s *header_t;
|
||||||
|
|
||||||
|
|
||||||
/* Our handle context. */
|
/* Our handle context. */
|
||||||
struct http_context_s
|
struct http_context_s
|
||||||
{
|
{
|
||||||
unsigned int status_code;
|
unsigned int status_code;
|
||||||
int sock;
|
int sock;
|
||||||
|
@ -228,14 +228,14 @@ init_sockets (void)
|
||||||
if (initialized)
|
if (initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( WSAStartup( MAKEWORD (REQ_WINSOCK_MINOR, REQ_WINSOCK_MAJOR), &wsdata ) )
|
if ( WSAStartup( MAKEWORD (REQ_WINSOCK_MINOR, REQ_WINSOCK_MAJOR), &wsdata ) )
|
||||||
{
|
{
|
||||||
log_error ("error initializing socket library: ec=%d\n",
|
log_error ("error initializing socket library: ec=%d\n",
|
||||||
(int)WSAGetLastError () );
|
(int)WSAGetLastError () );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( LOBYTE(wsdata.wVersion) != REQ_WINSOCK_MAJOR
|
if ( LOBYTE(wsdata.wVersion) != REQ_WINSOCK_MAJOR
|
||||||
|| HIBYTE(wsdata.wVersion) != REQ_WINSOCK_MINOR )
|
|| HIBYTE(wsdata.wVersion) != REQ_WINSOCK_MINOR )
|
||||||
{
|
{
|
||||||
log_error ("socket library version is %x.%x - but %d.%d needed\n",
|
log_error ("socket library version is %x.%x - but %d.%d needed\n",
|
||||||
LOBYTE(wsdata.wVersion), HIBYTE(wsdata.wVersion),
|
LOBYTE(wsdata.wVersion), HIBYTE(wsdata.wVersion),
|
||||||
|
@ -260,7 +260,7 @@ static char *
|
||||||
make_header_line (const char *prefix, const char *suffix,
|
make_header_line (const char *prefix, const char *suffix,
|
||||||
const void *data, size_t len )
|
const void *data, size_t len )
|
||||||
{
|
{
|
||||||
static unsigned char bintoasc[] =
|
static unsigned char bintoasc[] =
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
"abcdefghijklmnopqrstuvwxyz"
|
"abcdefghijklmnopqrstuvwxyz"
|
||||||
"0123456789+/";
|
"0123456789+/";
|
||||||
|
@ -278,7 +278,7 @@ make_header_line (const char *prefix, const char *suffix,
|
||||||
*p++ = bintoasc[(((s[1]<<2)&074)|((s[2]>>6)&03))&077];
|
*p++ = bintoasc[(((s[1]<<2)&074)|((s[2]>>6)&03))&077];
|
||||||
*p++ = bintoasc[s[2]&077];
|
*p++ = bintoasc[s[2]&077];
|
||||||
}
|
}
|
||||||
if ( len == 2 )
|
if ( len == 2 )
|
||||||
{
|
{
|
||||||
*p++ = bintoasc[(s[0] >> 2) & 077];
|
*p++ = bintoasc[(s[0] >> 2) & 077];
|
||||||
*p++ = bintoasc[(((s[0] <<4)&060)|((s[1] >> 4)&017))&077];
|
*p++ = bintoasc[(((s[0] <<4)&060)|((s[1] >> 4)&017))&077];
|
||||||
|
@ -306,7 +306,7 @@ http_register_tls_callback ( gpg_error_t (*cb) (http_t, void *, int) )
|
||||||
tls_callback = (gpg_error_t (*) (http_t, gnutls_session_t, int))cb;
|
tls_callback = (gpg_error_t (*) (http_t, gnutls_session_t, int))cb;
|
||||||
#else
|
#else
|
||||||
(void)cb;
|
(void)cb;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -315,13 +315,13 @@ http_register_tls_callback ( gpg_error_t (*cb) (http_t, void *, int) )
|
||||||
pointer for completing the the request and to wait for the
|
pointer for completing the the request and to wait for the
|
||||||
response. */
|
response. */
|
||||||
gpg_error_t
|
gpg_error_t
|
||||||
http_open (http_t *r_hd, http_req_t reqtype, const char *url,
|
http_open (http_t *r_hd, http_req_t reqtype, const char *url,
|
||||||
const char *auth, unsigned int flags, const char *proxy,
|
const char *auth, unsigned int flags, const char *proxy,
|
||||||
void *tls_context, struct http_srv *srv, strlist_t headers)
|
void *tls_context, struct http_srv *srv, strlist_t headers)
|
||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
http_t hd;
|
http_t hd;
|
||||||
|
|
||||||
*r_hd = NULL;
|
*r_hd = NULL;
|
||||||
|
|
||||||
if (!(reqtype == HTTP_REQ_GET || reqtype == HTTP_REQ_POST))
|
if (!(reqtype == HTTP_REQ_GET || reqtype == HTTP_REQ_POST))
|
||||||
|
@ -339,7 +339,7 @@ http_open (http_t *r_hd, http_req_t reqtype, const char *url,
|
||||||
err = http_parse_uri (&hd->uri, url);
|
err = http_parse_uri (&hd->uri, url);
|
||||||
if (!err)
|
if (!err)
|
||||||
err = send_request (hd, auth, proxy, srv, headers);
|
err = send_request (hd, auth, proxy, srv, headers);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
if (!hd->fp_read && !hd->fp_write && hd->sock != -1)
|
if (!hd->fp_read && !hd->fp_write && hd->sock != -1)
|
||||||
|
@ -382,7 +382,7 @@ http_wait_response (http_t hd)
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
|
|
||||||
/* Make sure that we are in the data. */
|
/* Make sure that we are in the data. */
|
||||||
http_start_data (hd);
|
http_start_data (hd);
|
||||||
|
|
||||||
/* We dup the socket, to cope with the fact that fclose closes the
|
/* We dup the socket, to cope with the fact that fclose closes the
|
||||||
underlying socket. In TLS mode we don't do that because we can't
|
underlying socket. In TLS mode we don't do that because we can't
|
||||||
|
@ -455,7 +455,7 @@ http_wait_response (http_t hd)
|
||||||
be used as an HTTP proxy and any enabled $http_proxy gets
|
be used as an HTTP proxy and any enabled $http_proxy gets
|
||||||
ignored. */
|
ignored. */
|
||||||
gpg_error_t
|
gpg_error_t
|
||||||
http_open_document (http_t *r_hd, const char *document,
|
http_open_document (http_t *r_hd, const char *document,
|
||||||
const char *auth, unsigned int flags, const char *proxy,
|
const char *auth, unsigned int flags, const char *proxy,
|
||||||
void *tls_context, struct http_srv *srv,
|
void *tls_context, struct http_srv *srv,
|
||||||
strlist_t headers)
|
strlist_t headers)
|
||||||
|
@ -609,7 +609,7 @@ do_parse_uri (parsed_uri_t uri, int only_local_part)
|
||||||
|
|
||||||
p++;
|
p++;
|
||||||
if (*p == '/') /* There seems to be a hostname. */
|
if (*p == '/') /* There seems to be a hostname. */
|
||||||
{
|
{
|
||||||
p++;
|
p++;
|
||||||
if ((p2 = strchr (p, '/')))
|
if ((p2 = strchr (p, '/')))
|
||||||
*p2++ = 0;
|
*p2++ = 0;
|
||||||
|
@ -667,7 +667,7 @@ do_parse_uri (parsed_uri_t uri, int only_local_part)
|
||||||
return gpg_error (GPG_ERR_BAD_URI); /* Path includes a Nul. */
|
return gpg_error (GPG_ERR_BAD_URI); /* Path includes a Nul. */
|
||||||
p = p2 ? p2 : NULL;
|
p = p2 ? p2 : NULL;
|
||||||
|
|
||||||
if (!p || !*p)
|
if (!p || !*p)
|
||||||
return 0; /* We don't have a query string. Okay. */
|
return 0; /* We don't have a query string. Okay. */
|
||||||
|
|
||||||
/* Now parse the query string. */
|
/* Now parse the query string. */
|
||||||
|
@ -861,7 +861,7 @@ send_request (http_t hd, const char *auth,
|
||||||
|
|
||||||
if ( (proxy && *proxy)
|
if ( (proxy && *proxy)
|
||||||
|| ( (hd->flags & HTTP_FLAG_TRY_PROXY)
|
|| ( (hd->flags & HTTP_FLAG_TRY_PROXY)
|
||||||
&& (http_proxy = getenv (HTTP_PROXY_ENV))
|
&& (http_proxy = getenv (HTTP_PROXY_ENV))
|
||||||
&& *http_proxy ))
|
&& *http_proxy ))
|
||||||
{
|
{
|
||||||
parsed_uri_t uri;
|
parsed_uri_t uri;
|
||||||
|
@ -908,7 +908,7 @@ send_request (http_t hd, const char *auth,
|
||||||
if (hd->sock == -1)
|
if (hd->sock == -1)
|
||||||
{
|
{
|
||||||
xfree (proxy_authstr);
|
xfree (proxy_authstr);
|
||||||
return (save_errno
|
return (save_errno
|
||||||
? gpg_error_from_errno (save_errno)
|
? gpg_error_from_errno (save_errno)
|
||||||
: gpg_error (GPG_ERR_NOT_FOUND));
|
: gpg_error (GPG_ERR_NOT_FOUND));
|
||||||
}
|
}
|
||||||
|
@ -948,7 +948,7 @@ send_request (http_t hd, const char *auth,
|
||||||
if (auth || hd->uri->auth)
|
if (auth || hd->uri->auth)
|
||||||
{
|
{
|
||||||
char *myauth;
|
char *myauth;
|
||||||
|
|
||||||
if (auth)
|
if (auth)
|
||||||
{
|
{
|
||||||
myauth = xtrystrdup (auth);
|
myauth = xtrystrdup (auth);
|
||||||
|
@ -976,12 +976,12 @@ send_request (http_t hd, const char *auth,
|
||||||
return gpg_error_from_syserror ();
|
return gpg_error_from_syserror ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p = build_rel_path (hd->uri);
|
p = build_rel_path (hd->uri);
|
||||||
if (!p)
|
if (!p)
|
||||||
return gpg_error_from_syserror ();
|
return gpg_error_from_syserror ();
|
||||||
|
|
||||||
request = xtrymalloc (2 * strlen (server)
|
request = xtrymalloc (2 * strlen (server)
|
||||||
+ strlen (p)
|
+ strlen (p)
|
||||||
+ (authstr?strlen(authstr):0)
|
+ (authstr?strlen(authstr):0)
|
||||||
+ (proxy_authstr?strlen(proxy_authstr):0)
|
+ (proxy_authstr?strlen(proxy_authstr):0)
|
||||||
|
@ -1008,7 +1008,7 @@ send_request (http_t hd, const char *auth,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char portstr[35];
|
char portstr[35];
|
||||||
|
|
||||||
if (port == 80 || (srv && srv->used_server))
|
if (port == 80 || (srv && srv->used_server))
|
||||||
*portstr = 0;
|
*portstr = 0;
|
||||||
else
|
else
|
||||||
|
@ -1190,7 +1190,7 @@ my_read_line (
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if (!buffer) /* Must allocate a new buffer. */
|
if (!buffer) /* Must allocate a new buffer. */
|
||||||
{
|
{
|
||||||
length = 256;
|
length = 256;
|
||||||
buffer = xtrymalloc (length);
|
buffer = xtrymalloc (length);
|
||||||
*addr_of_buffer = buffer;
|
*addr_of_buffer = buffer;
|
||||||
|
@ -1207,7 +1207,7 @@ my_read_line (
|
||||||
while ((c = P_ES(getc) (fp)) != EOF)
|
while ((c = P_ES(getc) (fp)) != EOF)
|
||||||
{
|
{
|
||||||
if (nbytes == length) /* Increase the buffer. */
|
if (nbytes == length) /* Increase the buffer. */
|
||||||
{
|
{
|
||||||
if (length > maxlen) /* Limit reached. */
|
if (length > maxlen) /* Limit reached. */
|
||||||
{
|
{
|
||||||
/* Skip the rest of the line. */
|
/* Skip the rest of the line. */
|
||||||
|
@ -1312,7 +1312,7 @@ store_header (http_t hd, char *line)
|
||||||
while (*p == ' ' || *p == '\t')
|
while (*p == ' ' || *p == '\t')
|
||||||
p++;
|
p++;
|
||||||
value = p;
|
value = p;
|
||||||
|
|
||||||
for (h=hd->headers; h; h = h->next)
|
for (h=hd->headers; h; h = h->next)
|
||||||
if ( !strcmp (h->name, line) )
|
if ( !strcmp (h->name, line) )
|
||||||
break;
|
break;
|
||||||
|
@ -1544,9 +1544,11 @@ connect_server (const char *server, unsigned short port,
|
||||||
unsigned int flags, struct http_srv *srv)
|
unsigned int flags, struct http_srv *srv)
|
||||||
{
|
{
|
||||||
int sock = -1;
|
int sock = -1;
|
||||||
int srvcount = 0, fakesrv = 0;
|
int srvcount = 0;
|
||||||
|
int fakesrv = 0;
|
||||||
int hostfound = 0;
|
int hostfound = 0;
|
||||||
int srvindex, connected, chosen=-1;
|
int srvindex, connected;
|
||||||
|
int chosen = -1;
|
||||||
int last_errno = 0;
|
int last_errno = 0;
|
||||||
struct srventry *serverlist = NULL;
|
struct srventry *serverlist = NULL;
|
||||||
|
|
||||||
|
@ -1565,9 +1567,9 @@ connect_server (const char *server, unsigned short port,
|
||||||
if ( inaddr != INADDR_NONE )
|
if ( inaddr != INADDR_NONE )
|
||||||
{
|
{
|
||||||
struct sockaddr_in addr;
|
struct sockaddr_in addr;
|
||||||
|
|
||||||
memset(&addr,0,sizeof(addr));
|
memset(&addr,0,sizeof(addr));
|
||||||
|
|
||||||
sock = socket(AF_INET,SOCK_STREAM,0);
|
sock = socket(AF_INET,SOCK_STREAM,0);
|
||||||
if ( sock==INVALID_SOCKET )
|
if ( sock==INVALID_SOCKET )
|
||||||
{
|
{
|
||||||
|
@ -1575,9 +1577,9 @@ connect_server (const char *server, unsigned short port,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
addr.sin_family = AF_INET;
|
addr.sin_family = AF_INET;
|
||||||
addr.sin_port = htons(port);
|
addr.sin_port = htons(port);
|
||||||
memcpy (&addr.sin_addr,&inaddr,sizeof(inaddr));
|
memcpy (&addr.sin_addr,&inaddr,sizeof(inaddr));
|
||||||
|
|
||||||
if (!connect (sock,(struct sockaddr *)&addr,sizeof(addr)) )
|
if (!connect (sock,(struct sockaddr *)&addr,sizeof(addr)) )
|
||||||
return sock;
|
return sock;
|
||||||
|
@ -1644,7 +1646,7 @@ connect_server (const char *server, unsigned short port,
|
||||||
errno = save_errno;
|
errno = save_errno;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connect (sock, ai->ai_addr, ai->ai_addrlen))
|
if (connect (sock, ai->ai_addr, ai->ai_addrlen))
|
||||||
last_errno = errno;
|
last_errno = errno;
|
||||||
else
|
else
|
||||||
|
@ -1680,7 +1682,7 @@ connect_server (const char *server, unsigned short port,
|
||||||
xfree (serverlist);
|
xfree (serverlist);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
addr.sin_family = host->h_addrtype;
|
addr.sin_family = host->h_addrtype;
|
||||||
if (addr.sin_family != AF_INET)
|
if (addr.sin_family != AF_INET)
|
||||||
{
|
{
|
||||||
|
@ -1714,7 +1716,7 @@ connect_server (const char *server, unsigned short port,
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_GETADDRINFO */
|
#endif /* !HAVE_GETADDRINFO */
|
||||||
|
|
||||||
if(!fakesrv && chosen>-1 && srv)
|
if(!fakesrv && chosen >- 1 && srv)
|
||||||
{
|
{
|
||||||
srv->used_server = xstrdup (serverlist[chosen].target);
|
srv->used_server = xstrdup (serverlist[chosen].target);
|
||||||
srv->used_port = serverlist[chosen].port;
|
srv->used_port = serverlist[chosen].port;
|
||||||
|
@ -1753,9 +1755,9 @@ write_server (int sock, const char *data, size_t length)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
int nwritten;
|
int nwritten;
|
||||||
|
|
||||||
nwritten = send (sock, data, nleft, 0);
|
nwritten = send (sock, data, nleft, 0);
|
||||||
if ( nwritten == SOCKET_ERROR )
|
if ( nwritten == SOCKET_ERROR )
|
||||||
{
|
{
|
||||||
log_info ("network write failed: ec=%d\n", (int)WSAGetLastError ());
|
log_info ("network write failed: ec=%d\n", (int)WSAGetLastError ());
|
||||||
return gpg_error (GPG_ERR_NETWORK);
|
return gpg_error (GPG_ERR_NETWORK);
|
||||||
|
@ -1808,7 +1810,7 @@ cookie_read (void *cookie, void *buffer, size_t size)
|
||||||
if (nread == GNUTLS_E_AGAIN)
|
if (nread == GNUTLS_E_AGAIN)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = 50000;
|
tv.tv_usec = 50000;
|
||||||
select (0, NULL, NULL, NULL, &tv);
|
select (0, NULL, NULL, NULL, &tv);
|
||||||
|
@ -1829,7 +1831,7 @@ cookie_read (void *cookie, void *buffer, size_t size)
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
/* Under Windows we need to use recv for a socket. */
|
/* Under Windows we need to use recv for a socket. */
|
||||||
nread = recv (c->fd, buffer, size, 0);
|
nread = recv (c->fd, buffer, size, 0);
|
||||||
#else
|
#else
|
||||||
nread = read (c->fd, buffer, size);
|
nread = read (c->fd, buffer, size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1852,7 +1854,7 @@ cookie_write (void *cookie, const void *buffer, size_t size)
|
||||||
int nleft = size;
|
int nleft = size;
|
||||||
while (nleft > 0)
|
while (nleft > 0)
|
||||||
{
|
{
|
||||||
nwritten = gnutls_record_send (c->tls_session, buffer, nleft);
|
nwritten = gnutls_record_send (c->tls_session, buffer, nleft);
|
||||||
if (nwritten <= 0)
|
if (nwritten <= 0)
|
||||||
{
|
{
|
||||||
if (nwritten == GNUTLS_E_INTERRUPTED)
|
if (nwritten == GNUTLS_E_INTERRUPTED)
|
||||||
|
@ -1860,7 +1862,7 @@ cookie_write (void *cookie, const void *buffer, size_t size)
|
||||||
if (nwritten == GNUTLS_E_AGAIN)
|
if (nwritten == GNUTLS_E_AGAIN)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = 50000;
|
tv.tv_usec = 50000;
|
||||||
select (0, NULL, NULL, NULL, &tv);
|
select (0, NULL, NULL, NULL, &tv);
|
||||||
|
@ -2037,7 +2039,7 @@ main (int argc, char **argv)
|
||||||
http_release_parsed_uri (uri);
|
http_release_parsed_uri (uri);
|
||||||
uri = NULL;
|
uri = NULL;
|
||||||
|
|
||||||
rc = http_open_document (&hd, *argv, NULL,
|
rc = http_open_document (&hd, *argv, NULL,
|
||||||
HTTP_FLAG_NO_SHUTDOWN | HTTP_FLAG_NEED_HEADER,
|
HTTP_FLAG_NO_SHUTDOWN | HTTP_FLAG_NEED_HEADER,
|
||||||
NULL, tls_session);
|
NULL, tls_session);
|
||||||
if (rc)
|
if (rc)
|
||||||
|
|
|
@ -36,29 +36,30 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef HAVE_GETOPT_H
|
#ifdef HAVE_GETOPT_H
|
||||||
#include <getopt.h>
|
# include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LIBCURL
|
#ifdef HAVE_LIBCURL
|
||||||
#include <curl/curl.h>
|
# include <curl/curl.h>
|
||||||
/* This #define rigamarole is to enable a hack to fake DNS SRV using
|
/* This #define rigamarole is to enable a hack to fake DNS SRV using
|
||||||
libcurl. It only works if we have getaddrinfo(), inet_ntop(), and
|
libcurl. It only works if we have getaddrinfo(), inet_ntop(), and
|
||||||
a modern enough version of libcurl (7.21.3) so we can use
|
a modern enough version of libcurl (7.21.3) so we can use
|
||||||
CURLOPT_RESOLVE to feed the resolver from the outside to force
|
CURLOPT_RESOLVE to feed the resolver from the outside to force
|
||||||
libcurl to pass the right SNI. */
|
libcurl to pass the right SNI. */
|
||||||
#if defined(HAVE_GETADDRINFO) && defined(HAVE_INET_NTOP) && LIBCURL_VERNUM >= 0x071503
|
# if (defined(HAVE_GETADDRINFO) && defined(HAVE_INET_NTOP) \
|
||||||
#include <sys/types.h>
|
&& LIBCURL_VERNUM >= 0x071503)
|
||||||
#include <sys/socket.h>
|
# include <sys/types.h>
|
||||||
#include <netdb.h>
|
# include <sys/socket.h>
|
||||||
#include <arpa/inet.h>
|
# include <netdb.h>
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
# else
|
||||||
|
# undef USE_DNS_SRV
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
#undef USE_DNS_SRV
|
# include "curl-shim.h"
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#include "curl-shim.h"
|
|
||||||
#endif
|
#endif
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#ifdef USE_DNS_SRV
|
#ifdef USE_DNS_SRV
|
||||||
#include "srv.h"
|
# include "srv.h"
|
||||||
#endif
|
#endif
|
||||||
#include "keyserver.h"
|
#include "keyserver.h"
|
||||||
#include "ksutil.h"
|
#include "ksutil.h"
|
||||||
|
@ -73,9 +74,10 @@ static char errorbuffer[CURL_ERROR_SIZE];
|
||||||
static char *proto,*port;
|
static char *proto,*port;
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
curl_mrindex_writer(const void *ptr,size_t size,size_t nmemb,void *stream)
|
curl_mrindex_writer (const void *ptr,size_t size,size_t nmemb,void *stream)
|
||||||
{
|
{
|
||||||
static int checked=0,swallow=0;
|
static int checked = 0;
|
||||||
|
static int swallow = 0;
|
||||||
|
|
||||||
if(!checked)
|
if(!checked)
|
||||||
{
|
{
|
||||||
|
@ -367,7 +369,7 @@ get_name(const char *getkey)
|
||||||
ret=KEYSERVER_NO_MEMORY;
|
ret=KEYSERVER_NO_MEMORY;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(output,"NAME %s BEGIN\n",getkey);
|
fprintf(output,"NAME %s BEGIN\n",getkey);
|
||||||
|
|
||||||
if(opt->verbose>2)
|
if(opt->verbose>2)
|
||||||
|
@ -617,7 +619,7 @@ srv_replace(const char *srvtag,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_help (FILE *fp)
|
show_help (FILE *fp)
|
||||||
{
|
{
|
||||||
fprintf (fp,"-h, --help\thelp\n");
|
fprintf (fp,"-h, --help\thelp\n");
|
||||||
|
@ -827,7 +829,7 @@ main(int argc,char *argv[])
|
||||||
/* We're using libcurl, so fake SRV support via our wrapper.
|
/* We're using libcurl, so fake SRV support via our wrapper.
|
||||||
This isn't as good as true SRV support, as we do not try all
|
This isn't as good as true SRV support, as we do not try all
|
||||||
possible targets at one particular level and work our way
|
possible targets at one particular level and work our way
|
||||||
down the list, but it's better than nothing. */
|
down the list, but it's better than nothing. */
|
||||||
#ifdef USE_DNS_SRV
|
#ifdef USE_DNS_SRV
|
||||||
srv_replace(srvtag,&headers,&resolve);
|
srv_replace(srvtag,&headers,&resolve);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue