public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: lilydjwg <lilydjwg@gmail.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH v2 2/2] debuginfod-client.c: Fix x-debuginfod-size counts differently than CURLINFO_SIZE_DOWNLOAD_T
Date: Fri, 31 Mar 2023 12:50:17 +0800	[thread overview]
Message-ID: <ZCZmiXh5fWwbXudJ@lilyforest.localdomain> (raw)
In-Reply-To: <20230330172413.GG30778@redhat.com>

On Thu, Mar 30, 2023 at 01:24:13PM -0400, Frank Ch. Eigler wrote:
> > The written_size is actual file size (uncompressed), but IIUC
> > Content-Length is the compressed size if Content-Encoding says the
> > content is compressed. I haven't seen any compressed responses with
> > Content-Length, but from the spec I don't read they are not allowed.
> 
> OK, so to spell out the hypothetical problem: what if a httpd server
> does send back a Content-Length: response header for a compressed
> file, and we use that as the denominator for progress reporting.  If
> we use the decompressed actual file length as numerator, we'd go over
> 100%.
> 
> Then ISTM a simpler way to handle this would be to say that if the
> x-debuginfod-size: response header is found (as denominator), then go
> ahead and use the actual data[committed_to].written_size (as
> numerator).  Don't even try the CURLINFO_SIZE* queries then.

It's not tried in that case. size_compressed indicates where the total
size is from and those CURLINFO_SIZE* is skipped. Maybe I should rename
the variable to something else (it's not always compressed).

Or do you mean that you want to always use written_size even when the
progress may go beyond 100%?

-- 
Best regards,
lilydjwg

  reply	other threads:[~2023-03-31  4:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  4:51 [PATCH] debuginfod-client.c: Fix download size not correctly fallbacks to x-debuginfod-size header lilydjwg
2023-03-29 12:28 ` Frank Ch. Eigler
2023-03-29 14:57   ` lilydjwg
2023-03-29 15:02     ` [PATCH v2 1/2] " lilydjwg
2023-03-29 15:02       ` [PATCH v2 2/2] debuginfod-client.c: Fix x-debuginfod-size counts differently than CURLINFO_SIZE_DOWNLOAD_T lilydjwg
2023-03-29 19:14         ` Frank Ch. Eigler
2023-03-30  3:41           ` lilydjwg
2023-03-30 17:24             ` Frank Ch. Eigler
2023-03-31  4:50               ` lilydjwg [this message]
2023-08-29 13:17                 ` Mark Wielaard
2023-08-29 18:33                   ` PR30809, was " Frank Ch. Eigler
2023-08-29 19:26                     ` Mark Wielaard
2023-03-29 20:49       ` [PATCH v2 1/2] debuginfod-client.c: Fix download size not correctly fallbacks to x-debuginfod-size header Frank Ch. Eigler
2023-03-29 15:05     ` [PATCH] " lilydjwg

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=ZCZmiXh5fWwbXudJ@lilyforest.localdomain \
    --to=lilydjwg@gmail.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).