Skip to content

Commit f2357da

Browse files
authored
[Debuginfod] Accept compressed encodings in client (llvm#68055)
All encodings that the underlying libcurl supports are automatically detected and accepted. libcurl will then decompress on the fly. This improves effective network transfer rate and prevents server-side decompression for files stored compressed. Fixes llvm#63534
1 parent 6d209bd commit f2357da

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

llvm/lib/Debuginfod/HTTPClient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ HTTPClient::HTTPClient() {
9797
assert(Curl && "Curl could not be initialized");
9898
// Set the callback hooks.
9999
curl_easy_setopt(Curl, CURLOPT_WRITEFUNCTION, curlWriteFunction);
100+
// Detect supported compressed encodings and accept all.
101+
curl_easy_setopt(Curl, CURLOPT_ACCEPT_ENCODING, "");
100102
}
101103

102104
HTTPClient::~HTTPClient() { curl_easy_cleanup(Curl); }

llvm/test/tools/llvm-debuginfod-find/headers.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ RUN: env DEBUGINFOD_CACHE=%t/debuginfod-cache DEBUGINFOD_HEADERS_FILE=%S/Inputs/
1616
RUN: | FileCheck --check-prefix ERR -DHEADER_FILE=%S/Inputs/headers %s
1717

1818
NO-HEADERS: Accept: */*
19+
NO-HEADERS-NEXT: Accept-Encoding: {{.*}}
1920
NO-HEADERS-NOT: {{.}}
2021

2122
HEADERS: Accept: */*
23+
HEADERS-NEXT: Accept-Encoding: {{.*}}
2224
HEADERS-NEXT: A: B
2325
HEADERS-NEXT: C: D
2426
HEADERS-NEXT: E: F

0 commit comments

Comments
 (0)