diff options
-rw-r--r-- | nar-herder/mirror.scm | 10 | ||||
-rw-r--r-- | scripts/nar-herder.in | 10 |
2 files changed, 11 insertions, 9 deletions
diff --git a/nar-herder/mirror.scm b/nar-herder/mirror.scm index 594a163..4ccf878 100644 --- a/nar-herder/mirror.scm +++ b/nar-herder/mirror.scm @@ -83,14 +83,13 @@ (open-socket-for-uri* uri))) (http-get uri #:port port - #:decode-body? #f))) + #:streaming? #t))) #:timeout 30)) #:times 3 #:delay 15)) (lambda (response body) (if (= (response-code response) 200) - (let* ((json-body (json-string->scm - (utf8->string body))) + (let* ((json-body (json->scm body)) (recent-changes (assoc-ref json-body "recent_changes"))) @@ -158,10 +157,9 @@ recent-changes)) (raise-exception (make-exception-with-message - (simple-format #f "unknown response: ~A\n code: ~A response: ~A" + (simple-format #f "unknown response: ~A code: ~A" (uri->string uri) - (response-code response) - (utf8->string body)))))))) + (response-code response)))))))) (spawn-fiber (lambda () diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index 18fe6d5..247eeef 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -36,6 +36,7 @@ (srfi srfi-19) (srfi srfi-37) (srfi srfi-43) + (srfi srfi-71) (ice-9 ftw) (ice-9 match) (ice-9 format) @@ -480,9 +481,12 @@ (lambda () (simple-format (current-error-port) "starting downloading the database\n") - (http-get database-uri - #:decode-body? #f - #:streaming? #t)) + (let ((port + socket + (open-socket-for-uri* database-uri))) + (http-get database-uri + #:port port + #:streaming? #t))) (lambda (response body) (when (not (= (response-code response) 200)) (error "unable to fetch database from mirror")) |