From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C32E13858C2C for ; Fri, 22 Apr 2022 23:27:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C32E13858C2C Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-6ay2HBQLN-2ZHbiHTNRWRA-1; Fri, 22 Apr 2022 19:27:33 -0400 X-MC-Unique: 6ay2HBQLN-2ZHbiHTNRWRA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0B9183804527 for ; Fri, 22 Apr 2022 23:27:33 +0000 (UTC) Received: from redhat.com (unknown [10.2.16.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EFE20145BEFF; Fri, 22 Apr 2022 23:27:32 +0000 (UTC) Received: from fche by redhat.com with local (Exim 4.94.2) (envelope-from ) id 1ni2gW-0007CB-29; Fri, 22 Apr 2022 19:27:32 -0400 Date: Fri, 22 Apr 2022 19:27:31 -0400 From: "Frank Ch. Eigler" To: Aaron Merey Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH 2/2] debuginfod: ensure X-DEBUGINFOD-SIZE contains file size Message-ID: <20220422232731.GF23969@redhat.com> References: <20220422222641.316502-1-amerey@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220422222641.316502-1-amerey@redhat.com> User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2022 23:27:36 -0000 Hi - > - add_mhd_response_header (r, "X-DEBUGINFOD-SIZE", > - to_string(fs.st_size).c_str()); > + rc = fstat (fd, &fs); > + if (rc == 0) > + add_mhd_response_header (r, "X-DEBUGINFOD-SIZE", > + to_string(fs.st_size).c_str()); > + else > + { > + close (fd); > + throw libc_exception (errno, string("stat ") + b_source1 + " archive " + b_source0); > + } It shouldn't require a new fstat -- the archive component file's size should be available from libarchive already: archive_entry_size(e); - FChE