LLVM  15.0.0git
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
llvm::HTTPClient Class Reference

A reusable client that can perform HTTPRequests through a network socket. More...

#include "llvm/Debuginfod/HTTPClient.h"

Collaboration diagram for llvm::HTTPClient:
Collaboration graph
[legend]

Public Member Functions

 HTTPClient ()
 
 ~HTTPClient ()
 
void setTimeout (std::chrono::milliseconds Timeout)
 Sets the timeout for the entire request, in milliseconds. More...
 
Error perform (const HTTPRequest &Request, HTTPResponseHandler &Handler)
 Performs the Request, passing response data to the Handler. More...
 
unsigned responseCode ()
 Returns the last received response code or zero if none. More...
 

Static Public Member Functions

static bool isAvailable ()
 Returns true only if LLVM has been compiled with a working HTTPClient. More...
 
static void initialize ()
 Must be called at the beginning of a program, while it is a single thread. More...
 
static void cleanup ()
 Must be called at the end of a program, while it is a single thread. More...
 

Static Public Attributes

static bool IsInitialized = false
 

Detailed Description

A reusable client that can perform HTTPRequests through a network socket.

Definition at line 50 of file HTTPClient.h.

Constructor & Destructor Documentation

◆ HTTPClient()

HTTPClient::HTTPClient ( )
default

◆ ~HTTPClient()

HTTPClient::~HTTPClient ( )
default

Member Function Documentation

◆ cleanup()

void HTTPClient::cleanup ( )
static

Must be called at the end of a program, while it is a single thread.

Definition at line 141 of file HTTPClient.cpp.

Referenced by HTTPClientCleanup::~HTTPClientCleanup().

◆ initialize()

void HTTPClient::initialize ( )
static

Must be called at the beginning of a program, while it is a single thread.

Definition at line 139 of file HTTPClient.cpp.

◆ isAvailable()

bool HTTPClient::isAvailable ( )
static

Returns true only if LLVM has been compiled with a working HTTPClient.

Definition at line 137 of file HTTPClient.cpp.

Referenced by llvm::getCachedOrDownloadArtifact().

◆ perform()

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 145 of file HTTPClient.cpp.

References llvm_unreachable.

◆ responseCode()

unsigned HTTPClient::responseCode ( )

Returns the last received response code or zero if none.

Definition at line 150 of file HTTPClient.cpp.

References llvm_unreachable.

◆ setTimeout()

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 143 of file HTTPClient.cpp.

Referenced by llvm::getCachedOrDownloadArtifact().

Member Data Documentation

◆ IsInitialized

bool HTTPClient::IsInitialized = false
static

Definition at line 59 of file HTTPClient.h.

Referenced by llvm::getCachedOrDownloadArtifact().


The documentation for this class was generated from the following files: