diff --git a/guix/build/download.scm b/guix/build/download.scm index db0a39084b..2eee984b31 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -409,18 +409,24 @@ (define addresses (socket (addrinfo:fam ai) SOCK_STREAM IPPROTO_IP)))) (catch 'system-error (lambda () - (connect* s (addrinfo:addr ai) timeout) - + (pk 'uri (uri->string uri)) + (pk 'before s (addrinfo:addr ai) timeout) + (pk 'connect* (connect* s (addrinfo:addr ai) timeout)) + (pk 'done) ;; Buffer input and output on this port. (setvbuf s 'block) ;; If we're using a proxy, make a note of that. (when http-proxy (set-http-proxy-port?! s #t)) s) (lambda args + (pk 'failed s) ;; Connection failed, so try one of the other addresses. (close s) + (pk 'closed) (if (null? (cdr addresses)) - (apply throw args) + (begin + (pk 'boum) + (apply throw args)) (loop (cdr addresses)))))))) (define (setup-http-tunnel port uri) @@ -465,6 +471,7 @@ (define https-proxy (let ((proxy (getenv "https_proxy"))) (parameterize ((current-http-proxy https-proxy)) (thunk)) (thunk))))))) + (with-https-proxy (let ((s (open-socket-for-uri uri #:timeout timeout))) ;; Buffer input and output on this port.