libzypp 17.38.5
curlhelper.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
13
14#include <zypp-core/Globals.h>
15
17#include <zypp-core/Pathname.h>
21#include <zypp-curl/ProxyInfo>
22#include <zypp-curl/auth/CurlAuthData>
23#include <zypp-media/MediaException>
24#include <string>
25#include <glib.h>
26
27#define TRANSFER_TIMEOUT_MAX 60 * 60
28
29using std::endl;
30using namespace zypp;
31
32namespace zypp
33{
34 namespace env
35 {
36 const long & ZYPP_MEDIA_CURL_DEBUG()
37 {
38 static const long ret = [](){
39 const char * env = getenv("ZYPP_MEDIA_CURL_DEBUG");
40 return env && *env ? str::strtonum<ulong>( env ) : 0;
41 }();
42 return ret;
43 }
44
46 {
47 static int _v = [](){
48 int ret = 0;
49 if ( const char * envp = getenv( "ZYPP_MEDIA_CURL_IPRESOLVE" ) ) {
50 WAR << "env set: $ZYPP_MEDIA_CURL_IPRESOLVE='" << envp << "'" << std::endl;
51 if ( strcmp( envp, "4" ) == 0 ) ret = 4;
52 else if ( strcmp( envp, "6" ) == 0 ) ret = 6;
53 }
54 return ret;
55 }();
56 return _v;
57 }
58 } // namespace env
59} // namespace zypp
60
61namespace internal
62{
63
65{
66 // function-level static <=> std::call_once
67 static bool once __attribute__ ((__unused__)) = ( [] {
68 MIL << "global_init libcurl: build version: (" << LIBCURL_VERSION << "), runtime version: (" << curl_version_info(CURLVERSION_NOW)->version << ") " << endl;
69 if ( curl_global_init( CURL_GLOBAL_ALL ) != 0 )
70 WAR << "curl global init failed" << std::endl;
71 } (), true );
72}
73
75{
76 auto curlV = curl_version_info ( CURLVERSION_NOW );
77 return curlV->version_num;
78}
79
80int log_curl( CURL * curl, curl_infotype info, char * ptr, size_t len, void * max_lvl )
81{
82 if ( max_lvl == nullptr )
83 return 0;
84
85 long maxlvl = *(static_cast<long*>(max_lvl));
86 const char * pfx = "";
87 bool isContent = true; // otherwise it's data
88 switch( info )
89 {
90 case CURLINFO_TEXT: if ( maxlvl < 1 ) return 0; pfx = "*"; break;
91 case CURLINFO_HEADER_IN: if ( maxlvl < 2 ) return 0; pfx = "<"; break;
92 case CURLINFO_HEADER_OUT: if ( maxlvl < 2 ) return 0; pfx = ">"; break;
93 case CURLINFO_SSL_DATA_IN: if ( maxlvl < 3 ) return 0; isContent = false; pfx = "<[SSL]"; break;
94 case CURLINFO_SSL_DATA_OUT: if ( maxlvl < 3 ) return 0; isContent = false; pfx = ">[SSL]"; break;
95 case CURLINFO_DATA_IN: if ( maxlvl < 3 ) return 0; isContent = false; pfx = "<[DTA]"; break;
96 case CURLINFO_DATA_OUT: if ( maxlvl < 3 ) return 0; isContent = false; pfx = ">[DTA]"; break;
97
98 default:
99 return 0;
100 }
101
102 // We'd like to keep all log messages within function `log_curl`
103 // because this tag to grep for is known and communicate to users.
104 if ( isContent ) {
105 std::vector<std::string_view> lines; // don't want log from within the lambda
106 strv::split( std::string_view( ptr, len ), "\n", [&lines]( std::string_view line, unsigned, bool last ) {
107 if ( last ) return; // empty word after final \n
108 line = strv::rtrim( line, "\r" );
109 lines.push_back( line );
110 });
111 for ( const auto & line : lines ) {
112 if ( str::hasPrefix( line, "Authorization:" ) ) {
113 std::string_view::size_type pos { line.find( " ", 15 ) }; // Authorization: <type> <credentials>
114 if ( pos == std::string::npos )
115 pos = 15;
116 DBG << curl << " " << pfx << " " << line.substr( 0, pos ) << " <credentials removed>" << endl;
117 }
118 else
119 DBG << curl << " " << pfx << " " << line << endl;
120 }
121 } else {
122 if ( maxlvl < 4 )
123 DBG << curl << " " << pfx << " " << len << " byte" << endl;
124 else
125 hexdumpOn( DBG << curl << " " << pfx << " ", ptr, len );
126 }
127 return 0;
128}
129
131{
132 if ( not curl ) {
133 INT << "Got a NULL curl handle" << endl;
134 return;
135 }
136 if ( env::ZYPP_MEDIA_CURL_DEBUG() > 0 ) {
137 curl_easy_setopt( curl, CURLOPT_VERBOSE, 1L );
138 curl_easy_setopt( curl, CURLOPT_DEBUGFUNCTION, log_curl );
139 curl_easy_setopt( curl, CURLOPT_DEBUGDATA, &env::ZYPP_MEDIA_CURL_DEBUG() );
140 }
141}
142
143size_t log_redirects_curl( char *ptr, size_t size, size_t nmemb, void *userdata)
144{
145 //INT << "got header: " << std::string(ptr, ptr + size*nmemb) << endl;
146
147 char * lstart = ptr, * lend = ptr;
148 size_t pos = 0;
149 size_t max = size * nmemb;
150 while (pos + 1 < max)
151 {
152 // get line
153 for (lstart = lend; *lend != '\n' && pos < max; ++lend, ++pos);
154
155 // look for "Location"
156 if ( strncasecmp( lstart, "Location:", 9 ) == 0 )
157 {
158 std::string line { lstart, *(lend-1)=='\r' ? lend-1 : lend };
159 DBG << "redirecting to " << line << std::endl;
160 if ( userdata ) {
161 *reinterpret_cast<std::string *>( userdata ) = line;
162 }
163 return max;
164 }
165
166 // continue with the next line
167 if (pos + 1 < max)
168 {
169 ++lend;
170 ++pos;
171 }
172 else
173 break;
174 }
175
176 return max;
177}
178
179
181{
183
184 // if the proxy was not set (or explicitly unset) by url, then look...
185 if ( s.proxy().empty() )
187
188 // remove extra options from the URL
189 url_r = ::internal::clearQueryString( url_r );
190}
191
197{
198 {
199 const std::string & param { url.getQueryParam("timeout") };
200 if( ! param.empty() )
201 {
202 long num = str::strtonum<long>(param);
203 if( num >= 0 && num <= TRANSFER_TIMEOUT_MAX )
204 s.setTimeout( num );
205 }
206 }
207 {
208 std::string param { url.getUsername() };
209 if ( ! param.empty() )
210 {
211 s.setUsername( std::move(param) );
212 param = url.getPassword();
213 if ( ! param.empty() ) {
214 pDBG( "setPassword from", url );
215 s.setPassword( std::move(param) );
216 }
217 }
218 else
219 {
220 // if there is no username, set anonymous auth
221 if ( url.schemeIsFtpLike() )
223 }
224 }
225 if ( url.getScheme() == "https" )
226 {
227 s.setVerifyPeerEnabled( false );
228 s.setVerifyHostEnabled( false );
229
230 const std::string & verify { url.getQueryParam("ssl_verify") };
231 if( verify.empty() || verify == "yes" )
232 {
233 s.setVerifyPeerEnabled( true );
234 s.setVerifyHostEnabled( true );
235 }
236 else if ( verify == "no" )
237 {
238 s.setVerifyPeerEnabled( false );
239 s.setVerifyHostEnabled( false );
240 }
241 else
242 {
243 std::vector<std::string> flags;
244 str::split( verify, std::back_inserter(flags), "," );
245 for ( const auto & flag : flags )
246 {
247 if ( flag == "host" )
248 s.setVerifyHostEnabled( true );
249 else if ( flag == "peer" )
250 s.setVerifyPeerEnabled( true );
251 else
252 ZYPP_THROW( media::MediaBadUrlException(url, "Unknown ssl_verify flag "+flag) );
253 }
254 }
255 }
256 {
257 Pathname ca_path { url.getQueryParam("ssl_capath") };
258 if( ! ca_path.empty() )
259 {
260 if( ! PathInfo(ca_path).isDir() || ! ca_path.absolute() )
261 ZYPP_THROW(media::MediaBadUrlException(url, "Invalid ssl_capath path"));
262 else
263 s.setCertificateAuthoritiesPath( std::move(ca_path) );
264 }
265 }
266 {
267 Pathname client_cert { url.getQueryParam("ssl_clientcert") };
268 if( ! client_cert.empty() )
269 {
270 if( ! PathInfo(client_cert).isFile() || ! client_cert.absolute() )
271 ZYPP_THROW(media::MediaBadUrlException(url, "Invalid ssl_clientcert file"));
272 else
273 s.setClientCertificatePath( std::move(client_cert) );
274 }
275 }
276 {
277 Pathname client_key { url.getQueryParam("ssl_clientkey") };
278 if( ! client_key.empty() )
279 {
280 if( ! PathInfo(client_key).isFile() || ! client_key.absolute() )
281 ZYPP_THROW(media::MediaBadUrlException(url, "Invalid ssl_clientkey file"));
282 else
283 s.setClientKeyPath( std::move(client_key) );
284 }
285 }
286 {
287 std::string param { url.getQueryParam( "proxy" ) };
288 if ( ! param.empty() )
289 {
290 if ( param == EXPLICITLY_NO_PROXY ) {
291 // Workaround TransferSettings shortcoming: With an
292 // empty proxy string, code will continue to look for
293 // valid proxy settings. So set proxy to some non-empty
294 // string, to indicate it has been explicitly disabled.
296 s.setProxyEnabled(false);
297 }
298 else {
299 const std::string & proxyport { url.getQueryParam( "proxyport" ) };
300 if ( ! proxyport.empty() ) {
301 param += ":";
302 param += proxyport;
303 }
304 s.setProxy( std::move(param) );
305 s.setProxyEnabled( true );
306 }
307 }
308 }
309 {
310 std::string param { url.getQueryParam( "proxyuser" ) };
311 if ( ! param.empty() )
312 {
313 s.setProxyUsername( std::move(param) );
314 s.setProxyPassword( url.getQueryParam( "proxypass" ) );
315 }
316 }
317 {
318 // HTTP/FTP authentication type
319 if ( url.schemeIsHttpLike() ) {
320 std::string param { url.getQueryParam("auth") };
321 if ( ! param.empty() )
322 {
323 try
324 {
325 media::CurlAuthData::auth_type_str2long (param ); // check if we know it
326 }
327 catch ( const media::MediaException & ex_r )
328 {
329 DBG << "Rethrowing as MediaUnauthorizedException.";
331 }
332 s.setAuthType( std::move(param) );
333 }
334 } else if ( url.schemeIsFtpLike() ) {
335 // Well, there's is not much else, but setting it explicitly in advance
336 // will also preload the credentials before the 1st request.
337 s.setAuthType( "basic" );
338 }
339 }
340 {
341 // workarounds
342 const std::string & param { url.getQueryParam("head_requests") };
343 if( ! param.empty() && param == "no" )
344 s.setHeadRequestsAllowed( false );
345 }
346 {
347 const auto &cookieFileParam = url.getQueryParam( "cookies" );
348 if ( !cookieFileParam.empty() && str::strToBool( cookieFileParam, true ) )
349 s.setEnableCookieFile ( true );
350 else
351 s.setEnableCookieFile ( false );
352 }
353}
354
360{
361 media::ProxyInfo proxy_info;
362 if ( proxy_info.useProxyFor( url ) )
363 {
364 // We must extract any 'user:pass' from the proxy url
365 // otherwise they won't make it into curl (.curlrc wins).
366 try {
367 Url u( proxy_info.proxy( url ) );
368 s.setProxy( u.asString( url::ViewOption::WITH_SCHEME + url::ViewOption::WITH_HOST + url::ViewOption::WITH_PORT ) );
369 // don't overwrite explicit auth settings
370 if ( s.proxyUsername().empty() )
371 {
374 }
375 s.setProxyEnabled( true );
376 }
377 catch (...) {} // no proxy if URL is malformed
378 }
379}
380
381void curlEscape( std::string & str_r,
382 const char char_r, const std::string & escaped_r ) {
383 for ( std::string::size_type pos = str_r.find( char_r );
384 pos != std::string::npos; pos = str_r.find( char_r, pos ) ) {
385 str_r.replace( pos, 1, escaped_r );
386 }
387}
388
389std::string curlEscapedPath( std::string path_r ) {
390 curlEscape( path_r, ' ', "%20" );
391 return path_r;
392}
393
394std::string curlUnEscape( const std::string& text_r ) {
395 char * tmp = curl_unescape( text_r.c_str(), 0 );
396 std::string ret( tmp );
397 curl_free( tmp );
398 return ret;
399}
400
402{
403 Url curlUrl (url);
404 curlUrl.setUsername( "" );
405 curlUrl.setPassword( "" );
406 curlUrl.setPathParams( "" );
407 curlUrl.setFragment( "" );
408 curlUrl.delQueryParams( {
409 "cookies",
410 "proxy",
411 "proxyport",
412 "proxyuser",
413 "proxypass",
414 "ssl_capath",
415 "ssl_verify",
416 "ssl_clientcert",
417 "ssl_clientkey",
418 "timeout",
419 "auth",
420 "username",
421 "password",
422 "mediahandler",
423 "credentials",
424 "head_requests",
425 "mediahandler",
426 } );
427 return curlUrl;
428}
429
430// bsc#933839: propagate proxy settings passed in the repo URL
431// boo#1127591: propagate ssl settings passed in the repo URL
433{
434 using namespace std::literals::string_literals;
435 for ( const std::string &param : { "proxy"s, "proxyport"s, "proxyuser"s, "proxypass"s, "ssl_capath"s, "ssl_verify"s } )
436 {
437 const std::string & value( template_r.getQueryParam( param ) );
438 if ( ! value.empty() )
439 url_r.setQueryParam( param, value );
440 }
441 return url_r;
442}
443
445 curl_multi_setopt( _parent._multi, CURLMOPT_SOCKETFUNCTION, socketcb );
446 curl_multi_setopt( _parent._multi, CURLMOPT_SOCKETDATA, this );
447 curl_multi_setopt( _parent._multi, CURLMOPT_TIMERFUNCTION, timercb );
448 curl_multi_setopt( _parent._multi, CURLMOPT_TIMERDATA, this );
449}
450
452 curl_multi_setopt( _parent._multi, CURLMOPT_SOCKETFUNCTION, nullptr );
453 curl_multi_setopt( _parent._multi, CURLMOPT_SOCKETDATA, nullptr );
454 curl_multi_setopt( _parent._multi, CURLMOPT_TIMERFUNCTION, nullptr );
455 curl_multi_setopt( _parent._multi, CURLMOPT_TIMERDATA, nullptr );
456}
457
458int CurlPollHelper::socketcb(CURL *easy, curl_socket_t s, int what, CurlPollHelper *userp, void *sockp) {
459 auto it = std::find_if( userp->socks.begin(), userp->socks.end(), [&]( const GPollFD &fd){ return fd.fd == s; });
460 gushort events = 0;
461 if ( what == CURL_POLL_REMOVE ) {
462 if ( it == userp->socks.end() ) {
463 WAR << "Ignoring unknown socket in static_socketcb" << std::endl;
464 return 0;
465 }
466 userp->socks.erase(it);
467 return 0;
468 } else if ( what == CURL_POLL_IN ) {
469 events = G_IO_IN | G_IO_HUP | G_IO_ERR;
470 } else if ( what == CURL_POLL_OUT ) {
471 events = G_IO_OUT | G_IO_ERR;
472 } else if ( what == CURL_POLL_INOUT ) {
473 events = G_IO_IN | G_IO_OUT | G_IO_HUP | G_IO_ERR;
474 }
475
476 if ( it != userp->socks.end() ) {
477 it->events = events;
478 it->revents = 0;
479 } else {
480 userp->socks.push_back(
481 GPollFD{
482 .fd = s,
483 .events = events,
484 .revents = 0
485 }
486 );
487 }
488 return 0;
489}
490
492 if ( !thatPtr )
493 return 0;
494 if ( timeout_ms == -1 )
495 thatPtr->timeout_ms.reset(); // curl wants to delete its timer
496 else
497 thatPtr->timeout_ms = timeout_ms; // maximum time curl wants us to sleep
498 return 0;
499}
500
501CURLMcode internal::CurlPollHelper::handleSocketActions( const std::vector<GPollFD> &actionsFds , int first )
502{
503 for ( size_t sock = first; sock < actionsFds.size(); sock++ ) {
504 const auto &waitFd = actionsFds[sock];
505 if ( waitFd.revents == 0 )
506 continue;
507
508 int ev = 0;
509 if ( (waitFd.revents & G_IO_HUP) == G_IO_HUP
510 || (waitFd.revents & G_IO_IN) == G_IO_IN ) {
511 ev = CURL_CSELECT_IN;
512 }
513 if ( (waitFd.revents & G_IO_OUT) == G_IO_OUT ) {
514 ev |= CURL_CSELECT_OUT;
515 }
516 if ( (waitFd.revents & G_IO_ERR) == G_IO_ERR ) {
517 ev |= CURL_CSELECT_ERR;
518 }
519
520 int runn = 0;
521 CURLMcode mcode = curl_multi_socket_action( _parent._multi, waitFd.fd, ev, &runn );
522 if (mcode != CURLM_OK)
523 return mcode;
524 }
525 return CURLM_OK;
526}
527
529{
530 int handles = 0;
531 return curl_multi_socket_action( _parent._multi, CURL_SOCKET_TIMEOUT, 0, &handles );
532}
533
544CURLcode setCurlRedirProtocols(CURL *curl)
545{
546#if CURLVERSION_AT_LEAST(7,19,4)
547#if CURLVERSION_AT_LEAST(7,85,0)
548 // runtime version might be different from build version
549 if( ::internal::curlVersion() >= CURL_VERSION_BITS(7,85,0) ) {
550 return curl_easy_setopt ( curl, CURLOPT_REDIR_PROTOCOLS_STR, "https" );
551 } else {
552 return curl_easy_setopt ( curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS );
553 }
554#else
555 return curl_easy_setopt ( curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS );
556#endif
557#endif // #if CURLVERSION_AT_LEAST(7,19,4)
558 return CURLE_OK;
559}
560
561}
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Definition Exception.h:459
Provides API related macros.
#define pDBG
Definition LogTools.h:304
#define DBG
Definition Logger.h:99
#define MIL
Definition Logger.h:100
#define WAR
Definition Logger.h:101
#define INT
Definition Logger.h:104
struct _GPollFD GPollFD
Definition ZYppImpl.h:26
const std::string & msg() const
Return the message string provided to the ctor.
Definition Exception.h:206
Url manipulation class.
Definition Url.h:93
void delQueryParams(const std::set< std::string > &params)
remove multiple query parameters at once
Definition Url.cc:916
std::string asString() const
Returns a default string representation of the Url object.
Definition Url.cc:524
std::string getUsername(EEncoding eflag=zypp::url::E_DECODED) const
Returns the username from the URL authority.
Definition Url.cc:599
void setFragment(const std::string &fragment, EEncoding eflag=zypp::url::E_DECODED)
Set the fragment string in the URL.
Definition Url.cc:749
std::string getQueryParam(const std::string &param, EEncoding eflag=zypp::url::E_DECODED) const
Return the value for the specified query parameter.
Definition Url.cc:687
void setPassword(const std::string &pass, EEncoding eflag=zypp::url::E_DECODED)
Set the password in the URL authority.
Definition Url.cc:766
void setPathParams(const std::string &params)
Set the path parameters.
Definition Url.cc:856
void setQueryParam(const std::string &param, const std::string &value)
Set or add value for the specified query parameter.
Definition Url.cc:903
void setUsername(const std::string &user, EEncoding eflag=zypp::url::E_DECODED)
Set the username in the URL authority.
Definition Url.cc:757
std::string getPassword(EEncoding eflag=zypp::url::E_DECODED) const
Returns the password from the URL authority.
Definition Url.cc:607
Wrapper class for stat/lstat.
Definition PathInfo.h:226
bool absolute() const
Test for an absolute path.
Definition Pathname.h:119
bool empty() const
Test for an empty path.
Definition Pathname.h:117
static long auth_type_str2long(std::string &auth_type_str)
Converts a string of comma separated list of authetication type names into a long of ORed CURLAUTH_* ...
Just inherits Exception to separate media exceptions.
bool useProxyFor(const Url &url_r) const
Return true if enabled and url_r does not match noProxy.
Definition proxyinfo.cc:56
std::string proxy(const Url &url) const
Definition proxyinfo.cc:44
Holds transfer setting.
void setProxy(const std::string &val_r)
proxy to use if it is enabled
void setProxyEnabled(bool enabled)
whether the proxy is used or not
void setUsername(const std::string &val_r)
sets the auth username
void setProxyUsername(const std::string &val_r)
sets the proxy user
void setHeadRequestsAllowed(bool allowed)
set whether HEAD requests are allowed
const std::string & proxy() const
proxy host
void setVerifyHostEnabled(bool enabled)
Sets whether to verify host for ssl.
void setClientKeyPath(const Pathname &val_r)
Sets the SSL client key file.
void setClientCertificatePath(const Pathname &val_r)
Sets the SSL client certificate file.
void setPassword(const std::string &val_r)
sets the auth password
void setVerifyPeerEnabled(bool enabled)
Sets whether to verify host for ssl.
void setAnonymousAuth()
sets anonymous authentication (ie: for ftp)
void setEnableCookieFile(bool enable=true)
Enable or disable the use of the cookie file.
const std::string & proxyUsername() const
proxy auth username
void setAuthType(const std::string &val_r)
set the allowed authentication types
void setCertificateAuthoritiesPath(const Pathname &val_r)
Sets the SSL certificate authorities path.
void setProxyPassword(const std::string &val_r)
sets the proxy password
void setTimeout(long t)
set the transfer timeout
#define TRANSFER_TIMEOUT_MAX
Definition curlhelper.cc:27
#define EXPLICITLY_NO_PROXY
void prepareSettingsAndUrl(zypp::Url &url_r, zypp::media::TransferSettings &s)
void fillSettingsFromUrl(const Url &url, media::TransferSettings &s)
Fills the settings structure using options passed on the url for example ?timeout=x&proxy=foo.
size_t log_redirects_curl(char *ptr, size_t size, size_t nmemb, void *userdata)
void globalInitCurlOnce()
Definition curlhelper.cc:64
uint curlVersion()
Definition curlhelper.cc:74
zypp::Url propagateQueryParams(zypp::Url url_r, const zypp::Url &template_r)
std::string curlUnEscape(const std::string &text_r)
void setupZYPP_MEDIA_CURL_DEBUG(CURL *curl)
Setup CURLOPT_VERBOSE and CURLOPT_DEBUGFUNCTION according to env::ZYPP_MEDIA_CURL_DEBUG.
std::string curlEscapedPath(std::string path_r)
CURLcode setCurlRedirProtocols(CURL *curl)
void fillSettingsSystemProxy(const Url &url, media::TransferSettings &s)
Reads the system proxy configuration and fills the settings structure proxy information.
Url clearQueryString(const Url &url)
void curlEscape(std::string &str_r, const char char_r, const std::string &escaped_r)
int log_curl(CURL *curl, curl_infotype info, char *ptr, size_t len, void *max_lvl)
Definition curlhelper.cc:80
Namespace intended to collect all environment variables we use.
const long & ZYPP_MEDIA_CURL_DEBUG()
const long& for setting CURLOPT_DEBUGDATA Returns a reference to a static variable,...
Definition curlhelper.cc:36
int ZYPP_MEDIA_CURL_IPRESOLVE()
4/6 to force IPv4/v6
Definition curlhelper.cc:45
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition String.h:1097
bool strToBool(const C_Str &str, bool default_r)
Parse str into a bool depending on the default value.
Definition String.h:500
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
Definition String.h:602
TInt strtonum(const C_Str &str)
Parsing numbers from string.
Url details namespace.
Definition UrlBase.cc:58
@ E_ENCODED
Flag to request encoded string(s).
Definition UrlUtils.h:53
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & hexdumpOn(std::ostream &outs, const unsigned char *ptr, size_t size)
hexdump data on stream
Definition LogTools.h:768
static int socketcb(CURL *easy, curl_socket_t s, int what, CurlPollHelper *userp, void *sockp)
CurlPollHelper(CurlPoll &p)
CURLMcode handleSocketActions(const std::vector< GPollFD > &actionsFds, int first=0)
std::vector< GPollFD > socks
std::optional< long > timeout_ms
static int timercb(CURLM *, long timeout_ms, CurlPollHelper *thatPtr)