all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 46967@debbugs.gnu.org
Subject: bug#46967: Connection reuse for substitutes breaks with gzip
Date: Tue, 09 Mar 2021 14:13:08 +0100	[thread overview]
Message-ID: <87r1ko8o7v.fsf@gnu.org> (raw)
In-Reply-To: <8735x4a8m8.fsf@gnu.org> ("Ludovic Courtès"'s message of "Tue, 09 Mar 2021 12:07:11 +0100")

[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]

Even simpler:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env  guile ~/src/guix-debugging/http-pipelining-gzip.scm

;;; (port #<input-output: file 7fced4c20000>)

;;; (input #<input: file 7fced4c8ef50>)

;;; (drain "")

;;; (fetch 16397)

;;; (port #<input-output: file 7fced4c20000>)
Backtrace:
In ice-9/boot-9.scm:
  1736:10 11 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In unknown file:
          10 (apply-smob/0 #<thunk 7fced7866520>)
In ice-9/boot-9.scm:
    718:2  9 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
    619:8  8 (_ #(#(#<directory (guile-user) 7fced7869c80>)))
In ice-9/boot-9.scm:
   2806:4  7 (save-module-excursion _)
  4351:12  6 (_)
In /home/ludo/src/guix-debugging/http-pipelining-gzip.scm:
     18:4  5 (_)
In guix/http-client.scm:
   116:21  4 (http-fetch _ #:port _ #:text? _ #:buffered? _ #:open-connection _ #:keep-alive? _ # _ #:headers _ # _)
In web/client.scm:
   526:24  3 (http-request _ #:body _ #:verify-certificate? _ #:port _ #:method _ #:version _ #:keep-alive? _ # _ # …)
In web/response.scm:
   198:31  2 (read-response #<input-output: string 7fced4c20000>)
In web/http.scm:
  1194:12  1 (read-response-line _)
    252:2  0 (parse-http-version _ _ _)

web/http.scm:252:2: In procedure parse-http-version:
Bad http-version header component: <!DOCTYPE

--8<---------------cut here---------------end--------------->8---


[-- Attachment #2: reproducer --]
[-- Type: text/plain, Size: 980 bytes --]

(use-modules (guix http-client)
             ((guix build download) #:select (open-connection-for-uri))
             (guix utils)
             ((guix serialization) #:select (dump-port*))
             (web uri)
             (web request)
             (web response)
             (srfi srfi-1))

(define %base-url
  "https://guix.gnu.org")

(define port
  (open-connection-for-uri (string->uri %base-url)))

(let loop ()
  (define-values (input size)
    (http-fetch (string->uri %base-url)
                #:port (pk 'port port)
                #:text? #f
                #:open-connection open-connection-for-uri ;/cached
                #:keep-alive? #t
                #:buffered? #f))

  (define-values (decompressed pids)
    (filtered-port '("/run/current-system/profile/bin/cat") (pk 'input input)))

  (dump-port* decompressed (%make-void-port "w")
              (pk 'fetch size))

  (unless (every (compose zero? cdr waitpid) pids)
    (error "decomp error"))

  (loop))

  reply	other threads:[~2021-03-09 13:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-06 14:47 bug#46967: Connection reuse for substitutes breaks with gzip Ludovic Courtès
2021-03-09 11:07 ` Ludovic Courtès
2021-03-09 13:13   ` Ludovic Courtès [this message]
2021-03-11  8:26     ` Ludovic Courtès
2021-03-12 10:42       ` Ludovic Courtès
2021-03-12 15:08         ` Ludovic Courtès
2021-03-14 10:17           ` Ludovic Courtès
2021-03-16 18:34             ` Bonface Munyoki K.
2021-03-18  9:32               ` Ludovic Courtès
2021-03-10  1:28 ` Léo Le Bouter via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1ko8o7v.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=46967@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.