From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by sourceware.org (Postfix) with ESMTPS id 098E93858CDA for ; Thu, 30 Mar 2023 03:41:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 098E93858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x102e.google.com with SMTP id x15so16056911pjk.2 for ; Wed, 29 Mar 2023 20:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680147710; h=disposition-notification-to:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=6FoMAgejXL98g238RkHJqqHuUOhl+MGcXgdy2/Bd4Aw=; b=VaTDWk84K8CpCVj2rVCUt3ciSTBESR0kBb3Z/5hmUpZlbANzJW5UocufIZQEsLYs7B FfEpFz9FcS9MjQNmcOQXM9NbXipk/hGpzcKoRpDYaxLtyVH87NP6t8fzPfW4dEyVH5oE Wh9m0/TZcfYn5Dt7pxz+w7MYKVEAdI4YqM3olsGo1VIXPunw3C8bg3moHGjbhUYjN0F8 OkslTEqoOUKUyTDv98jPiEWyEePhQ1ayCgpOS75wBQ43nUAhiHBsRz4kYC/6OL3P0M4+ sEEXwX2PREzv9xgJmVbTArmwInGJFoZEdLLiWt4WwhEP54ikkVsDdiT67JRHPSWKuQ8B tkGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680147710; h=disposition-notification-to:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6FoMAgejXL98g238RkHJqqHuUOhl+MGcXgdy2/Bd4Aw=; b=Ev5bR/VFOyuJV1D93adz4TvvPRGso0/PqmxEjBq/5lwyjCK2wawiqdo5Hbs1e7dvmV mrqr+q2eY1Y1lVsaWd83L93DXLH5iYN2aEvw53OkW6+n605r4ZcWERX/dr2ME/fvBH6l GYmj5ia4BsUhydaZKYox2n7W+DyZUyOobF5VdZUZsXuHheLT7sCUFCEWBJuN4qbXX7F0 Mc9hLWPKUsawMEeHoclpj1E0Qc+0jiakJYyJSpa/TvEIDAP3m/PfIlTEqqcrjeQMOoZc hlvnXedUL1QhkeLbEbrmvDAk7ELyCPdGUu5AO1Tpqinmq7bkdYkTCv3CdIFXKVFR82Ze eXJg== X-Gm-Message-State: AO0yUKWftlGYClhUf4KdYT/H83BVkGZjzls5ENMSWwXpzxhKGQeYye6c 73imL0JarIUnoy6+giYNefvkCeFTeSmlkne6xRk= X-Google-Smtp-Source: AK7set+v7jeTuWnjQyO/bv+EJCQJVjrUNdyFkVdIN2rz9Mm+sS/MP9fZmaoEf/3chwh0gG4BLfZVZg== X-Received: by 2002:a05:6a20:4b02:b0:db:10c8:4c95 with SMTP id fp2-20020a056a204b0200b000db10c84c95mr18993349pzb.17.1680147709654; Wed, 29 Mar 2023 20:41:49 -0700 (PDT) Received: from localhost ([2a0c:b641:69c:e9b8:1::1]) by smtp.gmail.com with ESMTPSA id q14-20020a632a0e000000b005136181264fsm5824003pgq.34.2023.03.29.20.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 20:41:49 -0700 (PDT) Date: Thu, 30 Mar 2023 11:41:16 +0800 From: lilydjwg To: "Frank Ch. Eigler" 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 Message-ID: References: <20230329150237.896092-1-lilydjwg@gmail.com> <20230329150237.896092-2-lilydjwg@gmail.com> <20230329191443.GB30778@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230329191443.GB30778@redhat.com> X-Mailer: Mutt 2.2.10 (2023-03-25) X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GB_FREEMAIL_DISPTO,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Mar 29, 2023 at 03:14:43PM -0400, Frank Ch. Eigler wrote: > Hi - > > > x-debuginfod-size is the actual file size, but CURLINFO_SIZE_DOWNLOAD_T > > is transferred size, i.e. the gzipped one if gzip is on. > > Let's count written data and use that if and only if x-debuginfod-size > > is used. > > Hey, great idea actually tallying up writes in the callback function. > (We need to take care to clear that counter, in case of client object > reuse.) Also, can you think of some reason not to just use that value > at all times, i.e., without any of that "if and only if ..." business? The counter is in handle_data, and it is already cleared at "query_in_parallel:". I don't find other places that may reuse them. 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. -- Best regards, lilydjwg