From 633c491e2dad4c3a70eb045177c17bd2552d63f3 Mon Sep 17 00:00:00 2001 From: Andy Patterson Date: Sun, 5 Jul 2015 19:34:05 -0400 Subject: [PATCH] scripts: substitute: Avoid infinite looping when updating the substitute list * guix/scripts/substitute.scm (http-multiple-get): Make use of the current response before reconnecting. --- guix/scripts/substitute.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 8b4fa36..e767d0f 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -468,8 +468,9 @@ to read the response body. Return the list of results." ;; case we have to try again. Check whether that is the case. (match (assq 'connection (response-headers resp)) (('connection 'close) - (close-port p) - (connect requests result)) ;try again + (let ((first-result (proc head resp body))) + (close-port p) + (connect tail (cons first-result result)))) ;try again (_ (loop tail ;keep going (cons (proc head resp body) result))))))))))) -- 2.4.5