diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-11-12 23:15:18 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-11-12 23:47:01 +0100 |
commit | 1b9aefa394a57dabe38e0658a3b612e962d3fc5e (patch) | |
tree | 999fae829bfdf0956e49ee56939f97e1f42fb8a4 /guix/build | |
parent | 60fd51222f9d7ec90bdad37bca921f40f7f5b104 (diff) |
download: Always use AI_ADDRCONFIG when resolving host names.
* guix/build/download.scm (open-socket-for-uri): Always pass
AI_ADDRCONFIG to 'getaddrinfo' as recommended in the fine Guile
manual.
* guix/ftp-client.scm (ftp-open): Ditto.
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/download.scm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/guix/build/download.scm b/guix/build/download.scm index 17e8f8cb9e..8843804c40 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -298,8 +298,8 @@ not #f, it must be a (possibly inexact) number denoting the maximum duration in seconds to wait for the connection to complete; passed TIMEOUT, an ETIMEDOUT error is raised." ;; Includes a fix for <http://bugs.gnu.org/15368> which affects Guile's - ;; 'open-socket-for-uri' up to 2.0.11 included, and uses 'connect*' instead - ;; of 'connect'. + ;; 'open-socket-for-uri' up to 2.0.11 included, uses 'connect*' instead + ;; of 'connect', and uses AI_ADDRCONFIG. (define http-proxy (current-http-proxy)) (define uri (ensure-uri (or http-proxy uri-or-string))) @@ -309,9 +309,9 @@ ETIMEDOUT error is raised." (getaddrinfo (uri-host uri) (cond (port => number->string) (else (symbol->string (uri-scheme uri)))) - (if port - AI_NUMERICSERV - 0)) + (if (number? port) + (logior AI_ADDRCONFIG AI_NUMERICSERV) + AI_ADDRCONFIG)) (lambda (ai1 ai2) (equal? (addrinfo:addr ai1) (addrinfo:addr ai2)))))) |