libzypp  17.31.31
internal::CurlPollHelper Struct Reference

#include </home/abuild/rpmbuild/BUILD/libzypp-17.31.31/zypp-curl/private/curlhelper_p.h>

Classes

struct  CurlPoll
 

Public Member Functions

 CurlPollHelper (CurlPoll &p)
 
 ~CurlPollHelper ()
 
CURLMcode handleSocketActions (const std::vector< GPollFD > &actionsFds, int first=0)
 
CURLMcode handleTimout ()
 

Static Public Member Functions

static int socketcb (CURL *easy, curl_socket_t s, int what, CurlPollHelper *userp, void *sockp)
 
static int timercb (CURLM *, long timeout_ms, CurlPollHelper *thatPtr)
 

Public Attributes

CurlPoll_parent
 
std::vector< GPollFDsocks
 
std::optional< long > timeout_ms = 0
 

Detailed Description

Helper class to simplify using the curl multi API, takes care of remembering the registered sockets and the required curl timeout.

Definition at line 72 of file curlhelper_p.h.

Constructor & Destructor Documentation

◆ CurlPollHelper()

internal::CurlPollHelper::CurlPollHelper ( CurlPoll p)

Definition at line 412 of file curlhelper.cc.

◆ ~CurlPollHelper()

internal::CurlPollHelper::~CurlPollHelper ( )

Definition at line 419 of file curlhelper.cc.

Member Function Documentation

◆ handleSocketActions()

CURLMcode internal::CurlPollHelper::handleSocketActions ( const std::vector< GPollFD > &  actionsFds,
int  first = 0 
)

Iterator over the passed in poll fd's and call curl_multi_socket_action on them if one of them signals that events have happened

Definition at line 469 of file curlhelper.cc.

◆ handleTimout()

CURLMcode internal::CurlPollHelper::handleTimout ( )

Tells libcurl that the requested timeout was reached.

Definition at line 496 of file curlhelper.cc.

◆ socketcb()

int internal::CurlPollHelper::socketcb ( CURL *  easy,
curl_socket_t  s,
int  what,
CurlPollHelper userp,
void *  sockp 
)
static

Callback for libcurl when it wants us to track or stop us from tracking a socket

Definition at line 426 of file curlhelper.cc.

◆ timercb()

int internal::CurlPollHelper::timercb ( CURLM *  ,
long  timeout_ms,
CurlPollHelper thatPtr 
)
static

Callback for libcurl when it wants us to start/update/remove a timer

Definition at line 459 of file curlhelper.cc.

Member Data Documentation

◆ _parent

CurlPoll& internal::CurlPollHelper::_parent

Definition at line 102 of file curlhelper_p.h.

◆ socks

std::vector<GPollFD> internal::CurlPollHelper::socks

Definition at line 103 of file curlhelper_p.h.

◆ timeout_ms

std::optional<long> internal::CurlPollHelper::timeout_ms = 0

Definition at line 104 of file curlhelper_p.h.


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