libzypp  17.38.17
zypp::media::TransferSettings Class Reference

Holds transfer setting. More...

#include <zypp-curl/transfersettings.h>

Classes

class  Impl
 

Public Types

using Headers = std::vector< std::string >
 

Public Member Functions

 TransferSettings ()
 Constructs a transfer program cmd line access. More...
 
void reset ()
 reset the settings to the defaults More...
 
void addHeader (std::string &&val_r)
 add a header, on the form "Foo: Bar" (trims) More...
 
void addHeader (const std::string &val_r)
 
const Headers & headers () const
 returns a list of all added headers (trimmed) More...
 
void setUserAgentString (std::string &&val_r)
 sets the user agent ie: "Mozilla v3" (trims) More...
 
void setUserAgentString (const std::string &val_r)
 
const std::string & userAgentString () const
 user agent string (trimmed) More...
 
bool hasCredentials () const
 has a non-empty username and a non-empty password More...
 
std::ostream & logCredentials (std::ostream &str) const
 log credentials to stream hiding the password. More...
 
void setUsername (const std::string &val_r)
 sets the auth username More...
 
void setUsername (std::string &&val_r)
 
const std::string & username () const
 auth username More...
 
void setPassword (const std::string &val_r)
 sets the auth password More...
 
void setPassword (std::string &&val_r)
 
const std::string & password () const
 auth password More...
 
void setAnonymousAuth ()
 sets anonymous authentication (ie: for ftp) More...
 
void setProxyEnabled (bool enabled)
 whether the proxy is used or not More...
 
bool proxyEnabled () const
 proxy is enabled More...
 
void setProxy (const std::string &val_r)
 proxy to use if it is enabled More...
 
void setProxy (std::string &&val_r)
 
const std::string & proxy () const
 proxy host More...
 
bool hasProxyCredentials () const
 has a proxy username, maybe even the password More...
 
std::ostream & logProxyCredentials (std::ostream &str) const
 log credentials to stream hiding the password. More...
 
void setProxyUsername (const std::string &val_r)
 sets the proxy user More...
 
void setProxyUsername (std::string &&val_r)
 
const std::string & proxyUsername () const
 proxy auth username More...
 
void setProxyPassword (const std::string &val_r)
 sets the proxy password More...
 
void setProxyPassword (std::string &&val_r)
 
const std::string & proxyPassword () const
 proxy auth password More...
 
std::string proxyUserPassword () const
 returns the proxy user and password as a user:pass string More...
 
void setConnectTimeout (long t)
 set the connect timeout More...
 
long connectTimeout () const
 connection timeout More...
 
void setTimeout (long t)
 set the transfer timeout More...
 
long timeout () const
 transfer timeout More...
 
void setMaxConcurrentConnections (long v)
 Set maximum number of concurrent connections for a single transfer. More...
 
long maxConcurrentConnections () const
 Maximum number of concurrent connections for a single transfer. More...
 
void setMinDownloadSpeed (long v)
 Set minimum download speed (bytes per second) until the connection is dropped. More...
 
long minDownloadSpeed () const
 Minimum download speed (bytes per second) until the connection is dropped. More...
 
void setMinDownloadSpeedTime (long v)
 Set the time in seconds that the transfer speed must remain below minDownloadSpeed before the transfer is aborted. More...
 
long minDownloadSpeedTime () const
 The time in seconds that the transfer speed must remain below minDownloadSpeed before the transfer is aborted. More...
 
void setMaxDownloadSpeed (long v)
 Set max download speed (bytes per second) More...
 
long maxDownloadSpeed () const
 Maximum download speed (bytes per second) More...
 
void setMaxSilentTries (long v)
 Set maximum silent retries. More...
 
long maxSilentTries () const
 Maximum silent retries. More...
 
void setVerifyHostEnabled (bool enabled)
 Sets whether to verify host for ssl. More...
 
bool verifyHostEnabled () const
 Whether to verify host for ssl. More...
 
void setVerifyPeerEnabled (bool enabled)
 Sets whether to verify host for ssl. More...
 
bool verifyPeerEnabled () const
 Whether to verify peer for ssl. More...
 
void setCertificateAuthoritiesPath (const Pathname &val_r)
 Sets the SSL certificate authorities path. More...
 
void setCertificateAuthoritiesPath (Pathname &&val_r)
 
const Pathname & certificateAuthoritiesPath () const
 SSL certificate authorities path ( default: /etc/ssl/certs ) More...
 
void setAuthType (const std::string &val_r)
 set the allowed authentication types More...
 
void setAuthType (std::string &&val_r)
 
const std::string & authType () const
 get the allowed authentication types More...
 
void setHeadRequestsAllowed (bool allowed)
 set whether HEAD requests are allowed More...
 
bool headRequestsAllowed () const
 whether HEAD requests are allowed More...
 
void setClientCertificatePath (const Pathname &val_r)
 Sets the SSL client certificate file. More...
 
void setClientCertificatePath (Pathname &&val_r)
 
const Pathname & clientCertificatePath () const
 SSL client certificate file. More...
 
void setClientKeyPath (const Pathname &val_r)
 Sets the SSL client key file. More...
 
void setClientKeyPath (Pathname &&val_r)
 
const Pathname & clientKeyPath () const
 SSL client key file. More...
 
void setEnableCookieFile (bool enable=true)
 Enable or disable the use of the cookie file. More...
 
bool cookieFileEnabled () const
 

Static Public Member Functions

static std::ostream & logUserPass (std::ostream &str, const std::string &user_r, const std::string &pass_r)
 Log credentials to stream hiding the password ("","[user]","[user:########]"). More...
 

Protected Attributes

RWCOW_pointer< Impl > _impl
 

Detailed Description

Holds transfer setting.

Note
bsc#1212187: HTTP/2 RFC 9113 forbids fields ending with a space. The class asserts headers and userAgentString return trimmed strings. Strings are trimmed when set. Empty

Definition at line 33 of file transfersettings.h.

Member Typedef Documentation

◆ Headers

using zypp::media::TransferSettings::Headers = std::vector<std::string>

Definition at line 43 of file transfersettings.h.

Constructor & Destructor Documentation

◆ TransferSettings()

zypp::media::TransferSettings::TransferSettings ( )

Constructs a transfer program cmd line access.

Definition at line 130 of file transfersettings.cc.

Member Function Documentation

◆ logUserPass()

std::ostream & zypp::media::TransferSettings::logUserPass ( std::ostream &  str,
const std::string &  user_r,
const std::string &  pass_r 
)
static

Log credentials to stream hiding the password ("","[user]","[user:########]").

Definition at line 117 of file transfersettings.cc.

◆ reset()

void zypp::media::TransferSettings::reset ( )

reset the settings to the defaults

Definition at line 134 of file transfersettings.cc.

◆ addHeader() [1/2]

void zypp::media::TransferSettings::addHeader ( std::string &&  val_r)

add a header, on the form "Foo: Bar" (trims)

Definition at line 140 of file transfersettings.cc.

◆ addHeader() [2/2]

void zypp::media::TransferSettings::addHeader ( const std::string &  val_r)

Definition at line 138 of file transfersettings.cc.

◆ headers()

const TransferSettings::Headers & zypp::media::TransferSettings::headers ( ) const

returns a list of all added headers (trimmed)

Definition at line 143 of file transfersettings.cc.

◆ setUserAgentString() [1/2]

void zypp::media::TransferSettings::setUserAgentString ( std::string &&  val_r)

sets the user agent ie: "Mozilla v3" (trims)

Definition at line 152 of file transfersettings.cc.

◆ setUserAgentString() [2/2]

void zypp::media::TransferSettings::setUserAgentString ( const std::string &  val_r)

Definition at line 149 of file transfersettings.cc.

◆ userAgentString()

const std::string & zypp::media::TransferSettings::userAgentString ( ) const

user agent string (trimmed)

Definition at line 155 of file transfersettings.cc.

◆ hasCredentials()

bool zypp::media::TransferSettings::hasCredentials ( ) const

has a non-empty username and a non-empty password

Definition at line 159 of file transfersettings.cc.

◆ logCredentials()

std::ostream& zypp::media::TransferSettings::logCredentials ( std::ostream &  str) const
inline

log credentials to stream hiding the password.

Definition at line 67 of file transfersettings.h.

◆ setUsername() [1/2]

void zypp::media::TransferSettings::setUsername ( const std::string &  val_r)

sets the auth username

Definition at line 162 of file transfersettings.cc.

◆ setUsername() [2/2]

void zypp::media::TransferSettings::setUsername ( std::string &&  val_r)

Definition at line 165 of file transfersettings.cc.

◆ username()

const std::string & zypp::media::TransferSettings::username ( ) const

auth username

Definition at line 168 of file transfersettings.cc.

◆ setPassword() [1/2]

void zypp::media::TransferSettings::setPassword ( const std::string &  val_r)

sets the auth password

Definition at line 171 of file transfersettings.cc.

◆ setPassword() [2/2]

void zypp::media::TransferSettings::setPassword ( std::string &&  val_r)

Definition at line 174 of file transfersettings.cc.

◆ password()

const std::string & zypp::media::TransferSettings::password ( ) const

auth password

Definition at line 177 of file transfersettings.cc.

◆ setAnonymousAuth()

void zypp::media::TransferSettings::setAnonymousAuth ( )

sets anonymous authentication (ie: for ftp)

Definition at line 180 of file transfersettings.cc.

◆ setProxyEnabled()

void zypp::media::TransferSettings::setProxyEnabled ( bool  enabled)

whether the proxy is used or not

Definition at line 187 of file transfersettings.cc.

◆ proxyEnabled()

bool zypp::media::TransferSettings::proxyEnabled ( ) const

proxy is enabled

Definition at line 190 of file transfersettings.cc.

◆ setProxy() [1/2]

void zypp::media::TransferSettings::setProxy ( const std::string &  val_r)

proxy to use if it is enabled

Definition at line 194 of file transfersettings.cc.

◆ setProxy() [2/2]

void zypp::media::TransferSettings::setProxy ( std::string &&  val_r)

Definition at line 197 of file transfersettings.cc.

◆ proxy()

const std::string & zypp::media::TransferSettings::proxy ( ) const

proxy host

Definition at line 200 of file transfersettings.cc.

◆ hasProxyCredentials()

bool zypp::media::TransferSettings::hasProxyCredentials ( ) const

has a proxy username, maybe even the password

◆ logProxyCredentials()

std::ostream& zypp::media::TransferSettings::logProxyCredentials ( std::ostream &  str) const
inline

log credentials to stream hiding the password.

Definition at line 107 of file transfersettings.h.

◆ setProxyUsername() [1/2]

void zypp::media::TransferSettings::setProxyUsername ( const std::string &  val_r)

sets the proxy user

Definition at line 204 of file transfersettings.cc.

◆ setProxyUsername() [2/2]

void zypp::media::TransferSettings::setProxyUsername ( std::string &&  val_r)

Definition at line 207 of file transfersettings.cc.

◆ proxyUsername()

const std::string & zypp::media::TransferSettings::proxyUsername ( ) const

proxy auth username

Definition at line 210 of file transfersettings.cc.

◆ setProxyPassword() [1/2]

void zypp::media::TransferSettings::setProxyPassword ( const std::string &  val_r)

sets the proxy password

Definition at line 213 of file transfersettings.cc.

◆ setProxyPassword() [2/2]

void zypp::media::TransferSettings::setProxyPassword ( std::string &&  val_r)

Definition at line 216 of file transfersettings.cc.

◆ proxyPassword()

const std::string & zypp::media::TransferSettings::proxyPassword ( ) const

proxy auth password

Definition at line 219 of file transfersettings.cc.

◆ proxyUserPassword()

std::string zypp::media::TransferSettings::proxyUserPassword ( ) const

returns the proxy user and password as a user:pass string

Definition at line 222 of file transfersettings.cc.

◆ setConnectTimeout()

void zypp::media::TransferSettings::setConnectTimeout ( long  t)

set the connect timeout

Definition at line 239 of file transfersettings.cc.

◆ connectTimeout()

long zypp::media::TransferSettings::connectTimeout ( ) const

connection timeout

Definition at line 242 of file transfersettings.cc.

◆ setTimeout()

void zypp::media::TransferSettings::setTimeout ( long  t)

set the transfer timeout

Definition at line 232 of file transfersettings.cc.

◆ timeout()

long zypp::media::TransferSettings::timeout ( ) const

transfer timeout

Definition at line 235 of file transfersettings.cc.

◆ setMaxConcurrentConnections()

void zypp::media::TransferSettings::setMaxConcurrentConnections ( long  v)

Set maximum number of concurrent connections for a single transfer.

Definition at line 246 of file transfersettings.cc.

◆ maxConcurrentConnections()

long zypp::media::TransferSettings::maxConcurrentConnections ( ) const

Maximum number of concurrent connections for a single transfer.

Definition at line 249 of file transfersettings.cc.

◆ setMinDownloadSpeed()

void zypp::media::TransferSettings::setMinDownloadSpeed ( long  v)

Set minimum download speed (bytes per second) until the connection is dropped.

Definition at line 253 of file transfersettings.cc.

◆ minDownloadSpeed()

long zypp::media::TransferSettings::minDownloadSpeed ( ) const

Minimum download speed (bytes per second) until the connection is dropped.

Definition at line 256 of file transfersettings.cc.

◆ setMinDownloadSpeedTime()

void zypp::media::TransferSettings::setMinDownloadSpeedTime ( long  v)

Set the time in seconds that the transfer speed must remain below minDownloadSpeed before the transfer is aborted.

Definition at line 260 of file transfersettings.cc.

◆ minDownloadSpeedTime()

long zypp::media::TransferSettings::minDownloadSpeedTime ( ) const

The time in seconds that the transfer speed must remain below minDownloadSpeed before the transfer is aborted.

Definition at line 263 of file transfersettings.cc.

◆ setMaxDownloadSpeed()

void zypp::media::TransferSettings::setMaxDownloadSpeed ( long  v)

Set max download speed (bytes per second)

Definition at line 267 of file transfersettings.cc.

◆ maxDownloadSpeed()

long zypp::media::TransferSettings::maxDownloadSpeed ( ) const

Maximum download speed (bytes per second)

Definition at line 270 of file transfersettings.cc.

◆ setMaxSilentTries()

void zypp::media::TransferSettings::setMaxSilentTries ( long  v)

Set maximum silent retries.

Definition at line 274 of file transfersettings.cc.

◆ maxSilentTries()

long zypp::media::TransferSettings::maxSilentTries ( ) const

Maximum silent retries.

Definition at line 277 of file transfersettings.cc.

◆ setVerifyHostEnabled()

void zypp::media::TransferSettings::setVerifyHostEnabled ( bool  enabled)

Sets whether to verify host for ssl.

Definition at line 281 of file transfersettings.cc.

◆ verifyHostEnabled()

bool zypp::media::TransferSettings::verifyHostEnabled ( ) const

Whether to verify host for ssl.

Definition at line 284 of file transfersettings.cc.

◆ setVerifyPeerEnabled()

void zypp::media::TransferSettings::setVerifyPeerEnabled ( bool  enabled)

Sets whether to verify host for ssl.

Definition at line 288 of file transfersettings.cc.

◆ verifyPeerEnabled()

bool zypp::media::TransferSettings::verifyPeerEnabled ( ) const

Whether to verify peer for ssl.

Definition at line 291 of file transfersettings.cc.

◆ setCertificateAuthoritiesPath() [1/2]

void zypp::media::TransferSettings::setCertificateAuthoritiesPath ( const Pathname &  val_r)

Sets the SSL certificate authorities path.

Definition at line 319 of file transfersettings.cc.

◆ setCertificateAuthoritiesPath() [2/2]

void zypp::media::TransferSettings::setCertificateAuthoritiesPath ( Pathname &&  val_r)

Definition at line 322 of file transfersettings.cc.

◆ certificateAuthoritiesPath()

const Pathname & zypp::media::TransferSettings::certificateAuthoritiesPath ( ) const

SSL certificate authorities path ( default: /etc/ssl/certs )

Definition at line 325 of file transfersettings.cc.

◆ setAuthType() [1/2]

void zypp::media::TransferSettings::setAuthType ( const std::string &  val_r)

set the allowed authentication types

Definition at line 329 of file transfersettings.cc.

◆ setAuthType() [2/2]

void zypp::media::TransferSettings::setAuthType ( std::string &&  val_r)

Definition at line 332 of file transfersettings.cc.

◆ authType()

const std::string & zypp::media::TransferSettings::authType ( ) const

get the allowed authentication types

Definition at line 335 of file transfersettings.cc.

◆ setHeadRequestsAllowed()

void zypp::media::TransferSettings::setHeadRequestsAllowed ( bool  allowed)

set whether HEAD requests are allowed

Definition at line 339 of file transfersettings.cc.

◆ headRequestsAllowed()

bool zypp::media::TransferSettings::headRequestsAllowed ( ) const

whether HEAD requests are allowed

Definition at line 342 of file transfersettings.cc.

◆ setClientCertificatePath() [1/2]

void zypp::media::TransferSettings::setClientCertificatePath ( const Pathname &  val_r)

Sets the SSL client certificate file.

Definition at line 294 of file transfersettings.cc.

◆ setClientCertificatePath() [2/2]

void zypp::media::TransferSettings::setClientCertificatePath ( Pathname &&  val_r)

Definition at line 297 of file transfersettings.cc.

◆ clientCertificatePath()

const Pathname & zypp::media::TransferSettings::clientCertificatePath ( ) const

SSL client certificate file.

Definition at line 300 of file transfersettings.cc.

◆ setClientKeyPath() [1/2]

void zypp::media::TransferSettings::setClientKeyPath ( const Pathname &  val_r)

Sets the SSL client key file.

Definition at line 304 of file transfersettings.cc.

◆ setClientKeyPath() [2/2]

void zypp::media::TransferSettings::setClientKeyPath ( Pathname &&  val_r)

Definition at line 307 of file transfersettings.cc.

◆ clientKeyPath()

const Pathname & zypp::media::TransferSettings::clientKeyPath ( ) const

SSL client key file.

Definition at line 310 of file transfersettings.cc.

◆ setEnableCookieFile()

void zypp::media::TransferSettings::setEnableCookieFile ( bool  enable = true)

Enable or disable the use of the cookie file.

Definition at line 313 of file transfersettings.cc.

◆ cookieFileEnabled()

bool zypp::media::TransferSettings::cookieFileEnabled ( ) const

Definition at line 316 of file transfersettings.cc.

Member Data Documentation

◆ _impl

RWCOW_pointer<Impl> zypp::media::TransferSettings::_impl
protected

Definition at line 233 of file transfersettings.h.


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