summaryrefslogtreecommitdiff
path: root/debuginfod
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2022-04-25 11:10:46 -0400
committerAaron Merey <amerey@redhat.com>2022-04-25 11:10:46 -0400
commit08e448456e27339aeb326828d44069028518038a (patch)
tree50e335b6c206c4b4631acf10aaa04b0d931df7a8 /debuginfod
parent55fee962676fbff60c6b0469305bcb077910d64f (diff)
downloadelfutils-08e448456e27339aeb326828d44069028518038a.tar.gz
debuginfod: ensure X-DEBUGINFOD-SIZE contains file size
For archived files X-DEBUGINFOD-SIZE currently contains the size of the archive instead of the size of the uncompressed file. Fix this. Also add testcases to verify X-DEBUGINFOD-SIZE contains uncompressed file sizes. Signed-off-by: Aaron Merey <amerey@redhat.com>
Diffstat (limited to 'debuginfod')
-rw-r--r--debuginfod/debuginfod.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index adca8208..4aaf41c0 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -1790,7 +1790,7 @@ handle_buildid_r_match (bool internal_req_p,
add_mhd_response_header (r, "Content-Type",
"application/octet-stream");
add_mhd_response_header (r, "X-DEBUGINFOD-SIZE",
- to_string(fs.st_size).c_str());
+ to_string(archive_entry_size(e)).c_str());
add_mhd_response_header (r, "X-DEBUGINFOD-ARCHIVE",
b_source0.c_str());
add_mhd_response_header (r, "X-DEBUGINFOD-FILE", file.c_str());