LLVM 20.0.0git
|
A reusable client that can perform HTTPRequests through a network socket. More...
#include "llvm/Debuginfod/HTTPClient.h"
Public Member Functions | |
HTTPClient () | |
~HTTPClient () | |
void | setTimeout (std::chrono::milliseconds Timeout) |
Sets the timeout for the entire request, in milliseconds. | |
Error | perform (const HTTPRequest &Request, HTTPResponseHandler &Handler) |
Performs the Request, passing response data to the Handler. | |
unsigned | responseCode () |
Returns the last received response code or zero if none. | |
Static Public Member Functions | |
static bool | isAvailable () |
Returns true only if LLVM has been compiled with a working HTTPClient. | |
static void | initialize () |
Must be called at the beginning of a program, while it is a single thread. | |
static void | cleanup () |
Must be called at the end of a program, while it is a single thread. | |
Static Public Attributes | |
static bool | IsInitialized = false |
A reusable client that can perform HTTPRequests through a network socket.
Definition at line 53 of file HTTPClient.h.
|
default |
|
default |
|
static |
Must be called at the end of a program, while it is a single thread.
Definition at line 149 of file HTTPClient.cpp.
Referenced by HTTPClientCleanup::~HTTPClientCleanup().
|
static |
Must be called at the beginning of a program, while it is a single thread.
Definition at line 147 of file HTTPClient.cpp.
|
static |
Returns true only if LLVM has been compiled with a working HTTPClient.
Definition at line 145 of file HTTPClient.cpp.
Referenced by llvm::canUseDebuginfod(), and llvm::getCachedOrDownloadArtifact().
Error HTTPClient::perform | ( | const HTTPRequest & | Request, |
HTTPResponseHandler & | Handler | ||
) |
Performs the Request, passing response data to the Handler.
Returns all errors which occur during the request. Aborts if an error is returned by a Handler method.
Definition at line 153 of file HTTPClient.cpp.
References llvm_unreachable.
Referenced by llvm::getCachedOrDownloadArtifact().
unsigned HTTPClient::responseCode | ( | ) |
Returns the last received response code or zero if none.
Definition at line 158 of file HTTPClient.cpp.
References llvm_unreachable.
Referenced by llvm::getCachedOrDownloadArtifact().
void HTTPClient::setTimeout | ( | std::chrono::milliseconds | Timeout | ) |
Sets the timeout for the entire request, in milliseconds.
A zero or negative value means the request never times out.
Definition at line 151 of file HTTPClient.cpp.
Referenced by llvm::getCachedOrDownloadArtifact().
|
static |
Definition at line 62 of file HTTPClient.h.
Referenced by llvm::getCachedOrDownloadArtifact().