Commit Graph

10 Commits

Author SHA1 Message Date
Ludovic Courtès 005c8fc6e0 http-client: Remove monkey patching for 2.0.5.
* guix/http-client.scm (read-response-body*): Remove.
  (http-fetch): Remove hacks for 2.0.5.
2015-05-10 11:07:51 +02:00
Ludovic Courtès 7623848343 download: Work around Guile small-receive-buffer bug.
Previously, code using directly (guix build download) was still affected
by <http://bugs.gnu.org/15368>.  This includes source derivations, the
'guix download' command, and (guix gnu-maintenance).

'guix substitute' was unaffected since it used (guix http-client), which
already had the fix.

* guix/http-client.scm (open-socket-for-uri): Remove.
  (http-fetch): Remove #:buffered? argument to 'open-socket-for-uri';
  use 'setvbuf' instead.
* guix/scripts/substitute.scm (fetch): Likewise.
* guix/build/download.scm (open-socket-for-uri): New procedure, taken
  from guix/http-client.scm, but without the #:buffered? parameter.
2015-05-06 10:31:11 +02:00
Ludovic Courtès 0cc0095f3c http-client: Add workaround for HTTP pipelining on Guile <= 2.0.9.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/http-client.scm (make-delimited-input-port): New procedure.
  Install it in (web response) for Guile <= 2.0.9.
2015-04-08 21:41:04 +02:00
Ludovic Courtès 776463ba9f http-client: Monkey-patch 'make-chunked-input-port' on Guile <= 2.0.11.
Fixes <http://bugs.gnu.org/19976>.

* guix/http-client.scm (when-guile<=2.0.5): Rename to...
  (when-guile<=2.0.5-or-otherwise-broken): ... this.
  (%web-http): New variable.
  Monkey-patch 'make-chunked-input-port' when %WEB-HTTP defines
  'read-chunk-body'.
2015-03-03 22:58:45 +01:00
Ludovic Courtès c28606bd1d http-client: Update backport of chunked encoding support to Guile 2.0.5.
* guix/http-client.scm (read-chunk, read-chunk-body)
  [when-guile<=2.0.5]: Remove.
  (make-chunked-input-port) [when-guile<=2.0.5]: Update to Guile commit
  00d3ecf2.
2015-03-03 22:58:45 +01:00
Mark H Weaver 04dec194d8 download: Handle HTTP redirects to relative URI references.
Fixes <http://bugs.gnu.org/19840>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/build/download.scm: On Guile 2.0.11 or earlier, redefine the http
  "Location" header to accept relative URIs.
  (resolve-uri-reference): New exported procedure.
  (http-fetch): Use 'resolve-uri-reference' to resolve redirections.
* guix/http-client.scm (http-fetch): Use 'resolve-uri-reference'
2015-02-19 03:32:22 -05:00
Ludovic Courtès a68d976b66 download: Enlarge your receive buffer.
* guix/build/download.scm (open-connection-for-uri): Remove call to
  'setsockopt'.
* guix/http-client.scm (open-socket-for-uri)[rmem-max, buffer-size]: New
  variables.  Add call to 'setsockopt'.
2014-05-23 22:19:37 +02:00
Ludovic Courtès 706e9e575d substitute-binary: Gracefully handle HTTP GET errors.
* guix/http-client.scm (&http-get-error): New condition type.
  (http-fetch): Raise it instead of using 'error'.
* guix/scripts/substitute-binary.scm (fetch) <http>: Wrap body into
  'guard' form; gracefully handle 'http-get-error?' conditions.
2014-03-01 15:38:11 +01:00
Ludovic Courtès 7db3ff4a29 utils: Add `guile-version>?', and use it.
This fixes Guile version comparisons when (version) has a
vendor-specific suffix.

Reported by Andreas Enge <andreas@enge.fr>.

* guix/utils.scm (guile-version>?): New procedure.
* tests/utils.scm ("guile-version>? 1.8", "guile-version>? 10.5"): New
  tests.
* guix/scripts/substitute-binary.scm (fetch, progress-report-port): Use
  `guile-version>?' instead of `version>?'.
* guix/http-client.scm (when-guile<=2.0.5, http-fetch): Likewise.
2013-08-23 15:51:36 +02:00
Ludovic Courtès 3b8258c569 Rename (guix web) to (guix http-client).
* guix/web.scm: Rename to...
* guix/http-client.scm: ... this.
* guix/gnu-maintenance.scm, guix/scripts/substitute-binary.scm,
  Makefile.am, po/POTFILES.in: Update accordingly.
2013-07-14 16:44:15 +02:00