libzypp  17.23.3
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 169 of file MediaCurl.cc.

◆ SET_OPTION_OFFT

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

Definition at line 176 of file MediaCurl.cc.

◆ SET_OPTION_LONG

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

Definition at line 177 of file MediaCurl.cc.

◆ SET_OPTION_VOID

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

Definition at line 178 of file MediaCurl.cc.

Variable Documentation

◆ curl

CURL* curl

Definition at line 64 of file MediaCurl.cc.

◆ url

Url url

Definition at line 65 of file MediaCurl.cc.

◆ timeout

time_t timeout

Definition at line 66 of file MediaCurl.cc.

◆ reached

bool reached

Definition at line 67 of file MediaCurl.cc.

◆ fileSizeExceeded

bool fileSizeExceeded

Definition at line 68 of file MediaCurl.cc.

◆ report

callback::SendReport<DownloadProgressReport>* report

Definition at line 69 of file MediaCurl.cc.

◆ _expectedFileSize

ByteCount _expectedFileSize

Definition at line 70 of file MediaCurl.cc.

◆ _timeStart

time_t _timeStart = 0

Start total stats.

Definition at line 72 of file MediaCurl.cc.

◆ _timeLast

time_t _timeLast = 0

Start last period(~1sec)

Definition at line 73 of file MediaCurl.cc.

◆ _timeRcv

time_t _timeRcv = 0

Start of no-data timeout.

Definition at line 74 of file MediaCurl.cc.

◆ _timeNow

time_t _timeNow = 0

Now.

Definition at line 75 of file MediaCurl.cc.

◆ _dnlTotal

double _dnlTotal = 0.0

Bytes to download or 0 if unknown.

Definition at line 77 of file MediaCurl.cc.

◆ _dnlLast

double _dnlLast = 0.0

Bytes downloaded at period start.

Definition at line 78 of file MediaCurl.cc.

◆ _dnlNow

double _dnlNow = 0.0

Bytes downloaded now.

Definition at line 79 of file MediaCurl.cc.

◆ _dnlPercent

int _dnlPercent = 0

Percent completed or 0 if _dnlTotal is unknown.

Definition at line 81 of file MediaCurl.cc.

◆ _drateTotal

double _drateTotal = 0.0

Download rate so far.

Definition at line 83 of file MediaCurl.cc.

◆ _drateLast

double _drateLast = 0.0

Download rate in last period.

Definition at line 84 of file MediaCurl.cc.

◆ drate_period

double drate_period

Definition at line 148 of file MediaCurl.cc.

◆ dload_period

double dload_period

Definition at line 150 of file MediaCurl.cc.

◆ secs

long secs

Definition at line 152 of file MediaCurl.cc.

◆ drate_avg

double drate_avg

Definition at line 154 of file MediaCurl.cc.

◆ ltime

time_t ltime

Definition at line 156 of file MediaCurl.cc.

◆ dload

double dload

Definition at line 158 of file MediaCurl.cc.

◆ uload

double uload

Definition at line 160 of file MediaCurl.cc.