libzypp  17.23.8
MediaCurl.cc File Reference
#include <iostream>
#include <list>
#include <zypp/base/Logger.h>
#include <zypp/ExternalProgram.h>
#include <zypp/base/String.h>
#include <zypp/base/Gettext.h>
#include <zypp/base/Sysconfig.h>
#include <zypp/media/MediaCurl.h>
#include <zypp/media/ProxyInfo.h>
#include <zypp/media/MediaUserAuth.h>
#include <zypp/media/CredentialManager.h>
#include <zypp/media/CurlConfig.h>
#include <zypp/media/CurlHelper.h>
#include <zypp/Target.h>
#include <zypp/ZYppFactory.h>
#include <zypp/ZConfig.h>
#include <cstdlib>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <errno.h>
#include <dirent.h>
#include <unistd.h>
Include dependency graph for MediaCurl.cc:

Go to the source code of this file.

Namespaces

 zypp
 Easy-to use interface to the ZYPP dependency resolver.
 
 zypp::media
 

Macros

#define SET_OPTION(opt, val)
 
#define SET_OPTION_OFFT(opt, val)   SET_OPTION(opt,(curl_off_t)val)
 
#define SET_OPTION_LONG(opt, val)   SET_OPTION(opt,(long)val)
 
#define SET_OPTION_VOID(opt, val)   SET_OPTION(opt,(void*)val)
 

Macro Definition Documentation

◆ SET_OPTION

#define SET_OPTION (   opt,
  val 
)
Value:
do { \
ret = curl_easy_setopt ( _curl, opt, val ); \
if ( ret != 0) { \
ZYPP_THROW(MediaCurlSetOptException(_url, _curlError)); \
} \
} while ( false )
Todo:
deprecate SET_OPTION and use the typed versions below.

Definition at line 170 of file MediaCurl.cc.

◆ SET_OPTION_OFFT

#define SET_OPTION_OFFT (   opt,
  val 
)    SET_OPTION(opt,(curl_off_t)val)

Definition at line 177 of file MediaCurl.cc.

◆ SET_OPTION_LONG

#define SET_OPTION_LONG (   opt,
  val 
)    SET_OPTION(opt,(long)val)

Definition at line 178 of file MediaCurl.cc.

◆ SET_OPTION_VOID

#define SET_OPTION_VOID (   opt,
  val 
)    SET_OPTION(opt,(void*)val)

Definition at line 179 of file MediaCurl.cc.

Variable Documentation

◆ curl

CURL* curl

Definition at line 65 of file MediaCurl.cc.

◆ url

Url url

Definition at line 66 of file MediaCurl.cc.

◆ timeout

time_t timeout

Definition at line 67 of file MediaCurl.cc.

◆ reached

bool reached

Definition at line 68 of file MediaCurl.cc.

◆ fileSizeExceeded

bool fileSizeExceeded

Definition at line 69 of file MediaCurl.cc.

◆ report

callback::SendReport<DownloadProgressReport>* report

Definition at line 70 of file MediaCurl.cc.

◆ _expectedFileSize

ByteCount _expectedFileSize

Definition at line 71 of file MediaCurl.cc.

◆ _timeStart

time_t _timeStart = 0

Start total stats.

Definition at line 73 of file MediaCurl.cc.

◆ _timeLast

time_t _timeLast = 0

Start last period(~1sec)

Definition at line 74 of file MediaCurl.cc.

◆ _timeRcv

time_t _timeRcv = 0

Start of no-data timeout.

Definition at line 75 of file MediaCurl.cc.

◆ _timeNow

time_t _timeNow = 0

Now.

Definition at line 76 of file MediaCurl.cc.

◆ _dnlTotal

double _dnlTotal = 0.0

Bytes to download or 0 if unknown.

Definition at line 78 of file MediaCurl.cc.

◆ _dnlLast

double _dnlLast = 0.0

Bytes downloaded at period start.

Definition at line 79 of file MediaCurl.cc.

◆ _dnlNow

double _dnlNow = 0.0

Bytes downloaded now.

Definition at line 80 of file MediaCurl.cc.

◆ _dnlPercent

int _dnlPercent = 0

Percent completed or 0 if _dnlTotal is unknown.

Definition at line 82 of file MediaCurl.cc.

◆ _drateTotal

double _drateTotal = 0.0

Download rate so far.

Definition at line 84 of file MediaCurl.cc.

◆ _drateLast

double _drateLast = 0.0

Download rate in last period.

Definition at line 85 of file MediaCurl.cc.

◆ drate_period

double drate_period

Definition at line 149 of file MediaCurl.cc.

◆ dload_period

double dload_period

Definition at line 151 of file MediaCurl.cc.

◆ secs

long secs

Definition at line 153 of file MediaCurl.cc.

◆ drate_avg

double drate_avg

Definition at line 155 of file MediaCurl.cc.

◆ ltime

time_t ltime

Definition at line 157 of file MediaCurl.cc.

◆ dload

double dload

Definition at line 159 of file MediaCurl.cc.

◆ uload

double uload

Definition at line 161 of file MediaCurl.cc.