[PATCH] D121720: [Debuginfod] Don't depend on Content-Length.

Daniel Thornburgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 14:28:11 PDT 2022


mysterymath marked an inline comment as done.
mysterymath added a comment.

In D121720#3383783 <https://reviews.llvm.org/D121720#3383783>, @noajshu wrote:

> Indeed, an application can use the same `HTTPClient` from multiple threads; this new design prevents us from learning the individual response codes for concurrent requests.

If I'm interpreting the libcurl docs correctly, it doesn't seem like it's legal to issue multiple curl_easy_performs on the same Curl handle: https://curl.se/libcurl/c/curl_easy_perform.html
HTTPClient should still be usable in a multi-threaded fashion, but you'd need one HTTPClient per thread.

> If you agree, I think you can just un-delete the `handleResponseCode` declaration + definition and its invocation inside `perform()`.

I initially tried to do this, but as previously implemented, handleResponseCode only gets called after the full data transfer is complete, which is too late to decide whether or not to create a cache file.
We could parse the response code itself in handleHeaderLine, but that seemed a bit heavyweight, and I wasn't sure exactly how it'd interact with CURLOPT_FOLLOWLOCATION.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121720/new/

https://reviews.llvm.org/D121720



More information about the llvm-commits mailing list