summaryrefslogtreecommitdiff
path: root/guix/web.scm
AgeCommit message (Collapse)Author
2013-06-29substitute-binary: Avoid dangling connections to the server.Ludovic Courtès
* guix/web.scm (open-socket-for-uri): New procedure. (http-fetch): Add `port' keyword parameter; use it. * guix/scripts/substitute-binary.scm (%random-state): New variable. (with-timeout): Wait a little before retrying. (fetch): Use `open-socket-for-uri', and keep a copy of the socket in variable `port'. Close PORT upon timeout.
2013-06-10Fix Guile version checking in the "web" code.Cyril Roelandt
* guix/web.scm (http-fetch): fix Guile version checking. The previous version would use features from Guile 2.0.9+ when using Guile 2.0.7.
2013-05-15substitute-binary: Pass `filtered-port' an unbuffered port.Ludovic Courtès
This fixes a bug whereby `read-response' would read more than just the response, with the extra data going into the port's buffer; the "bzip2 -dc" process spawned by `filtered-port' would not see the those buffered data, which are definitely lost, and would bail out with "bzip2: (stdin) is not a bzip2 file." * guix/utils.scm (filtered-port): Document that INPUT must be unbuffered. * guix/web.scm (http-fetch): Add `buffered?' parameter. Call `open-socket-for-uri' explicitly, and call `setvbuf' when BUFFERED? is false. Pass the port to `http-get'. Close it upon 301/302. * guix/scripts/substitute-binary.scm (fetch): Add `buffered?' parameter. Pass it to `http-fetch'; honor it for `file' URIs. (guix-substitute-binary): Call `fetch' with #:buffered? #f for port RAW. * tests/utils.scm ("filtered-port, file"): Open FILE as unbuffered.
2013-04-27web: Add workaround for <http://bugs.gnu.org/13095>.Ludovic Courtès
* guix/web.scm: Add workaround for <http://bugs.gnu.org/13095>.
2013-04-27web: Add 2.0.5 workaround for responses without content-length.Ludovic Courtès
* guix/web.scm (read-response-body*)[when-guile<=2.0.5]: Support responses without content-length. Reported by Andreas Enge <andreas@enge.fr>.
2013-04-27web: Backport chunked encoding support for Guile <= 2.0.5.Ludovic Courtès
* guix/web.scm (when-guile<=2.0.5): New macro. (read-chunk-header, read-chunk, read-chunk-body, make-chunked-input-port, read-response-body*)[when-guile<=2.0.5]: New procedures. (http-fetch): Clarify message when (not data).
2013-04-25web: Factorize `http-get' hackery.Ludovic Courtès
This should fix `substitute-binary --query' on Guile 2.0.5. * guix/web.scm: New file. * Makefile.am (MODULES): Add it. * po/POTFILES.in: Add it. * guix/gnu-maintenance.scm (http-fetch): Remove. (%package-list-url): Turn into a URI. (official-gnu-packages): Add #:text? #t to `http-fetch' call. * guix/scripts/substitute-binary.scm (fetch): Remove `http' case, and use `http-fetch' instead.