http-client: No 'setvbuf' for non-file ports.

* guix/http-client.scm (http-fetch): Do not call 'setvbuf' on non-file
ports.
This commit is contained in:
Ludovic Courtès 2016-03-16 10:20:45 +01:00
parent 247d498aaa
commit 409e4ac6e3

View file

@ -243,7 +243,7 @@ (define* (http-fetch uri #:key port (text? #f) (buffered? #t)
(base64-encode
(string->utf8 str))))))
(_ '()))))
(unless buffered?
(unless (or buffered? (not (file-port? port)))
(setvbuf port _IONBF))
(let*-values (((resp data)
;; Try hard to use the API du jour to get an input port.