Changeset View
Changeset View
Standalone View
Standalone View
dirmngr/http.c
Context not available. | |||||
*/ | */ | ||||
/* Simple HTTP client implementation. We try to keep the code as | /* Simple HTTP client implementation. We try to keep the code as | ||||
self-contained as possible. There are some contraints however: | self-contained as possible. There are some constraints however: | ||||
- estream is required. We now require estream because it provides a | - estream is required. We now require estream because it provides a | ||||
very useful and portable asprintf implementation and the fopencookie | very useful and portable asprintf implementation and the fopencookie | ||||
Context not available. | |||||
if ((n = remove_escapes (uri->host)) < 0) | if ((n = remove_escapes (uri->host)) < 0) | ||||
return GPG_ERR_BAD_URI; | return GPG_ERR_BAD_URI; | ||||
if (n != strlen (uri->host)) | if (n != strlen (uri->host)) | ||||
return GPG_ERR_BAD_URI; /* Hostname incudes a Nul. */ | return GPG_ERR_BAD_URI; /* Hostname includes a Nul. */ | ||||
p = p2 ? p2 : NULL; | p = p2 ? p2 : NULL; | ||||
} | } | ||||
else if (uri->is_http) | else if (uri->is_http) | ||||
Context not available. | |||||
if (*line == ' ' || *line == '\t') | if (*line == ' ' || *line == '\t') | ||||
{ | { | ||||
/* Continuation. This won't happen too often as it is not | /* Continuation. This won't happen too often as it is not | ||||
recommended. We use a straightforward implementaion. */ | recommended. We use a straightforward implementation. */ | ||||
if (!hd->headers) | if (!hd->headers) | ||||
return GPG_ERR_PROTOCOL_VIOLATION; | return GPG_ERR_PROTOCOL_VIOLATION; | ||||
n += strlen (hd->headers->value); | n += strlen (hd->headers->value); | ||||
Context not available. | |||||
/* Return true if SOCKS shall be used. This is the case if tor_mode | /* Return true if SOCKS shall be used. This is the case if tor_mode | ||||
* is enabled and the desired address is not the loopback address. | * is enabled and the desired address is not the loopback address. | ||||
* This function is basically a copy of the same internal fucntion in | * This function is basically a copy of the same internal function in | ||||
* Libassuan. */ | * Libassuan. */ | ||||
static int | static int | ||||
use_socks (struct sockaddr *addr) | use_socks (struct sockaddr *addr) | ||||
Context not available. |