diff options
Diffstat (limited to 'fetch.c')
| -rw-r--r-- | fetch.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/fetch.c b/fetch.c index 47161b0..5c3006c 100644 --- a/fetch.c +++ b/fetch.c @@ -87,10 +87,10 @@ static const char *sockerror(tls_t); #else static int ftp_printf(FILE *, const char *, ...); #endif /* SMALL */ -#ifndef NOSSL -static int proxy_connect(int, char *, char *); -static int stdio_tls_write_wrapper(void *, const char *, int); -static int stdio_tls_read_wrapper(void *, char *, int); +#if !defined(NOSSL) || !NOSSL + static int proxy_connect(int, char *, char *); + static int stdio_tls_write_wrapper(void *, const char *, int); + static int stdio_tls_read_wrapper(void *, char *, int); #endif /* !NOSSL */ #define FTP_URL "ftp://" /* ftp URL prefix */ @@ -328,7 +328,7 @@ url_get(const char *origline, const char *proxyenv, const char *outfile, int las ssize_t len, wlen; size_t bufsize; char *proxyhost = NULL; -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL char *sslpath = NULL, *sslhost = NULL; int ishttpsurl = 0; #endif /* !NOSSL */ @@ -366,7 +366,7 @@ url_get(const char *origline, const char *proxyenv, const char *outfile, int las scheme = FTP_URL; #endif /* !SMALL */ } else if (strncasecmp(newline, HTTPS_URL, sizeof(HTTPS_URL) - 1) == 0) { -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL host = newline + sizeof(HTTPS_URL) - 1; ishttpsurl = 1; #else @@ -444,7 +444,7 @@ noslash: #endif /* !SMALL */ if (proxyenv != NULL) { /* use proxy */ -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL if (ishttpsurl) { sslpath = strdup(path); sslhost = strdup(host); @@ -514,7 +514,7 @@ noslash: portnum = strrchr(hosttail, ':'); /* find portnum */ if (portnum != NULL) *portnum++ = '\0'; -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL port = portnum ? portnum : (ishttpsurl ? httpsport : httpport); #else /* !NOSSL */ port = portnum ? portnum : httpport; @@ -541,7 +541,7 @@ noslash: if (error == EAI_SERVICE && port == httpport) { snprintf(pbuf, sizeof(pbuf), "%d", HTTP_PORT); error = getaddrinfo(host, pbuf, &hints, &res0); -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL } else if (error == EAI_SERVICE && port == httpsport) { snprintf(pbuf, sizeof(pbuf), "%d", HTTPS_PORT); error = getaddrinfo(host, pbuf, &hints, &res0); @@ -619,7 +619,7 @@ noslash: else port = NULL; -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL if (proxyenv && sslhost) proxy_connect(fd, sslhost, proxy_credentials); #endif /* !NOSSL */ @@ -635,7 +635,7 @@ noslash: goto cleanup_url_get; } -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL if (ishttpsurl) { ssize_t ret; if (proxyenv && sslpath) { @@ -694,7 +694,7 @@ noslash: /* * Construct and send the request. Proxy requests don't want leading /. */ -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL cookie_get(host, path, ishttpsurl, &buf); #endif /* !NOSSL */ @@ -763,7 +763,7 @@ noslash: * 80. Some broken HTTP servers get confused if you explicitly * send them the port number. */ -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL if (port && strcmp(port, (ishttpsurl ? "443" : "80")) != 0) ftp_printf(fin, ":%s", port); if (restart_point) @@ -788,7 +788,7 @@ noslash: } free(epath); -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL free(buf); #endif /* !NOSSL */ buf = NULL; @@ -1127,7 +1127,7 @@ cleanup_url_get: #ifndef SMALL free(full_host); #endif /* !SMALL */ -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL free(sslhost); #endif /* !NOSSL */ ftp_close(&fin, &tls, &fd); @@ -1645,7 +1645,7 @@ isurl(const char *p) if (strncasecmp(p, FTP_URL, sizeof(FTP_URL) - 1) == 0 || strncasecmp(p, HTTP_URL, sizeof(HTTP_URL) - 1) == 0 || -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL strncasecmp(p, HTTPS_URL, sizeof(HTTPS_URL) - 1) == 0 || #endif /* !NOSSL */ strncasecmp(p, FILE_URL, sizeof(FILE_URL) - 1) == 0 || @@ -1678,7 +1678,7 @@ ftp_printf(FILE *fp, const char *fmt, ...) static void ftp_close(FILE **fin, tls_t *tls, int *fd) { -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL int ret; if (*tls != NULL) { @@ -1706,7 +1706,7 @@ static const char * sockerror(tls_t tls) { int save_errno = errno; -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL if (tls != NULL) { const char *tlserr = tls_error(tls); if (tlserr != NULL) @@ -1716,7 +1716,7 @@ sockerror(tls_t tls) return strerror(save_errno); } -#ifndef NOSSL +#if !defined(NOSSL) || !NOSSL static int proxy_connect(int socket, char *host, char *cookie) { |