Nix  2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::curlFileTransfer::TransferItem Struct Reference
Collaboration diagram for nix::curlFileTransfer::TransferItem:
[legend]

Classes

struct  DownloadState
 

Public Member Functions

long getHTTPStatus ()
 
std::string verb () const
 
void appendCurlHeader (std::string_view name, std::string_view value)
 
 TransferItem (const std::string &uri, const Headers &headers, ActivityId parentAct, std::optional< std::string_view > uploadData, bool noBody, curl_off_t writtenToSink)
 
bool acceptsRanges ()
 
void failEx (std::exception_ptr ex)
 
template<class T >
void fail (T &&e)
 
void maybeFinishSetup ()
 
size_t writeCallback (void *contents, size_t size, size_t nmemb)
 
size_t headerCallback (void *contents, size_t size, size_t nmemb)
 
int progressCallback (double dltotal, double dlnow)
 
void finish (CURLcode code)
 

Static Public Member Functions

static size_t writeCallbackWrapper (void *contents, size_t size, size_t nmemb, void *userp)
 
static size_t headerCallbackWrapper (void *contents, size_t size, size_t nmemb, void *userp)
 
static int progressCallbackWrapper (void *userp, double dltotal, double dlnow, double ultotal, double ulnow)
 
static int debugCallback (CURL *handle, curl_infotype type, char *data, size_t size, void *userptr)
 

Public Attributes

std::string uri
 
FileTransferResultWithEncoding result
 
Activity act
 
std::unique_ptr< FILE, decltype([](FILE *f) { fclose(f);})> uploadData
 
Sync< DownloadStatedownloadState
 
std::condition_variable downloadEvent
 
bool headersDone = false
 
bool metadataReturned = false
 
std::promise< FileTransferResultWithEncoding > metadataPromise
 
std::string statusMsg
 
uint64_t bodySize = 0
 
std::unique_ptr< curl_slist, decltype([](auto *s) { curl_slist_free_all(s);})> requestHeaders
 
std::unique_ptr< CURL, decltype([](auto *c) { curl_easy_cleanup(c);})> req
 
char errbuf [CURL_ERROR_SIZE]
 
std::exception_ptr callbackException
 

Static Public Attributes

static const std::set< long > successfulStatuses {200, 201, 204, 206, 304, 0 }
 

The documentation for this struct was generated from the following file: