Librepo library 1.18.1
C library for downloading linux repository metadata and packages
Loading...
Searching...
No Matches
Librepo Handle

Macros

#define LRO_FASTESTMIRRORMAXAGE_DEFAULT   2592000L
 
#define LRO_FASTESTMIRRORMAXAGE_MIN   0L
 
#define LRO_PROXYPORT_DEFAULT   1080L
 
#define LRO_PROXYTYPE_DEFAULT   LR_PROXY_HTTP
 
#define LRO_MAXSPEED_DEFAULT   G_GINT64_CONSTANT(0)
 
#define LRO_CONNECTTIMEOUT_DEFAULT   30L
 
#define LRO_MAXMIRRORTRIES_DEFAULT   0L
 
#define LRO_MAXMIRRORTRIES_MIN   0L
 
#define LRO_MAXPARALLELDOWNLOADS_DEFAULT   3L
 
#define LRO_MAXPARALLELDOWNLOADS_MIN   1L
 
#define LRO_MAXPARALLELDOWNLOADS_MAX   20L
 
#define LRO_MAXDOWNLOADSPERMIRROR_DEFAULT   3L
 
#define LRO_MAXDOWNLOADSPERMIRROR_MIN   1L
 
#define LRO_LOWSPEEDTIME_MIN   0L
 
#define LRO_LOWSPEEDTIME_DEFAULT   30L
 
#define LRO_LOWSPEEDLIMIT_MIN   0L
 
#define LRO_LOWSPEEDLIMIT_DEFAULT   1000L
 
#define LRO_IPRESOLVE_DEFAULT   LR_IPRESOLVE_WHATEVER
 
#define LRO_ALLOWEDMIRRORFAILURES_DEFAULT   4L
 
#define LRO_ADAPTIVEMIRRORSORTING_DEFAULT   1L
 
#define LRO_GNUPGHOMEDIR_DEFAULT   NULL
 
#define LRO_FASTESTMIRRORTIMEOUT_DEFAULT   2.0
 
#define LRO_OFFLINE_DEFAULT   0L
 
#define LRO_HTTPAUTHMETHODS_DEFAULT   LR_AUTH_BASIC
 
#define LRO_PROXYAUTHMETHODS_DEFAULT   LR_AUTH_BASIC
 
#define LRO_FTPUSEEPSV_DEFAULT   1L
 

Typedefs

typedef struct _LrHandle LrHandle
 

Enumerations

enum  LrHandleOption {
  LRO_UPDATE , LRO_URLS , LRO_MIRRORLIST , LRO_MIRRORLISTURL ,
  LRO_METALINKURL , LRO_LOCAL , LRO_HTTPAUTH , LRO_USERPWD ,
  LRO_PROXY , LRO_PROXYPORT , LRO_PROXYTYPE , LRO_PROXYAUTH ,
  LRO_PROXYUSERPWD , LRO_PROGRESSCB , LRO_PROGRESSDATA , LRO_MAXSPEED ,
  LRO_DESTDIR , LRO_REPOTYPE , LRO_CONNECTTIMEOUT , LRO_IGNOREMISSING ,
  LRO_INTERRUPTIBLE , LRO_USERAGENT , LRO_FETCHMIRRORS , LRO_MAXMIRRORTRIES ,
  LRO_MAXPARALLELDOWNLOADS , LRO_MAXDOWNLOADSPERMIRROR , LRO_VARSUB , LRO_FASTESTMIRROR ,
  LRO_FASTESTMIRRORCACHE , LRO_FASTESTMIRRORMAXAGE , LRO_FASTESTMIRRORCB , LRO_FASTESTMIRRORDATA ,
  LRO_LOWSPEEDTIME , LRO_LOWSPEEDLIMIT , LRO_GPGCHECK , LRO_CHECKSUM ,
  LRO_YUMDLIST , LRO_RPMMDDLIST = LRO_YUMDLIST , LRO_YUMBLIST , LRO_RPMMDBLIST = LRO_YUMBLIST ,
  LRO_HMFCB , LRO_SSLVERIFYPEER , LRO_SSLVERIFYHOST , LRO_IPRESOLVE ,
  LRO_ALLOWEDMIRRORFAILURES , LRO_ADAPTIVEMIRRORSORTING , LRO_GNUPGHOMEDIR , LRO_FASTESTMIRRORTIMEOUT ,
  LRO_HTTPHEADER , LRO_OFFLINE , LRO_SSLCLIENTCERT , LRO_SSLCLIENTKEY ,
  LRO_SSLCACERT , LRO_HTTPAUTHMETHODS , LRO_PROXYAUTHMETHODS , LRO_FTPUSEEPSV ,
  LRO_YUMSLIST , LRO_CACHEDIR , LRO_PRESERVETIME , LRO_ONETIMEFLAG ,
  LRO_SSLVERIFYSTATUS , LRO_PROXY_SSLVERIFYPEER , LRO_PROXY_SSLVERIFYHOST , LRO_PROXY_SSLCLIENTCERT ,
  LRO_PROXY_SSLCLIENTKEY , LRO_PROXY_SSLCACERT , LRO_USERNAME , LRO_PASSWORD ,
  LRO_SENTINEL
}
 
enum  LrHandleInfoOption {
  LRI_UPDATE , LRI_URLS , LRI_MIRRORLIST , LRI_MIRRORLISTURL ,
  LRI_METALINKURL , LRI_LOCAL , LRI_PROGRESSCB , LRI_PROGRESSDATA ,
  LRI_DESTDIR , LRI_REPOTYPE , LRI_USERAGENT , LRI_YUMDLIST ,
  LRI_RPMMDDLIST = LRI_YUMDLIST , LRI_YUMBLIST , LRI_RPMMDBLIST = LRI_YUMBLIST , LRI_FETCHMIRRORS ,
  LRI_MAXMIRRORTRIES , LRI_VARSUB , LRI_MIRRORS , LRI_METALINK ,
  LRI_FASTESTMIRROR , LRI_FASTESTMIRRORCACHE , LRI_FASTESTMIRRORMAXAGE , LRI_HMFCB ,
  LRI_SSLVERIFYPEER , LRI_SSLVERIFYHOST , LRI_IPRESOLVE , LRI_ALLOWEDMIRRORFAILURES ,
  LRI_ADAPTIVEMIRRORSORTING , LRI_GNUPGHOMEDIR , LRI_FASTESTMIRRORTIMEOUT , LRI_HTTPHEADER ,
  LRI_OFFLINE , LRI_SSLCLIENTCERT , LRI_SSLCLIENTKEY , LRI_SSLCACERT ,
  LRI_LOWSPEEDTIME , LRI_LOWSPEEDLIMIT , LRI_HTTPAUTHMETHODS , LRI_PROXYAUTHMETHODS ,
  LRI_FTPUSEEPSV , LRI_YUMSLIST , LRI_CACHEDIR , LRI_SSLVERIFYSTATUS ,
  LRI_PROXY_SSLVERIFYPEER , LRI_PROXY_SSLVERIFYHOST , LRI_PROXY_SSLCLIENTCERT , LRI_PROXY_SSLCLIENTKEY ,
  LRI_PROXY_SSLCACERT , LRI_SENTINEL
}
 

Functions

LrHandlelr_handle_init (void)
 
void lr_handle_free (LrHandle *handle)
 
gboolean lr_handle_setopt (LrHandle *handle, GError **err, LrHandleOption option,...)
 
gboolean lr_handle_getinfo (LrHandle *handle, GError **err, LrHandleInfoOption option,...)
 
gboolean lr_handle_perform (LrHandle *handle, LrResult *result, GError **err)
 
gboolean lr_handle_network_wait (LrHandle *handle, GError **err, guint seconds, GCancellable *cancellable)
 

Detailed Description

Macro Definition Documentation

◆ LRO_ADAPTIVEMIRRORSORTING_DEFAULT

#define LRO_ADAPTIVEMIRRORSORTING_DEFAULT   1L

LRO_ADAPTIVEMIRRORSORTING default value

Definition at line 105 of file handle.h.

◆ LRO_ALLOWEDMIRRORFAILURES_DEFAULT

#define LRO_ALLOWEDMIRRORFAILURES_DEFAULT   4L

LRO_ALLOWEDMIRRORFAILURES default value

Definition at line 102 of file handle.h.

◆ LRO_CONNECTTIMEOUT_DEFAULT

#define LRO_CONNECTTIMEOUT_DEFAULT   30L

LRO_CONNECTTIMEOUT default value

Definition at line 63 of file handle.h.

◆ LRO_FASTESTMIRRORMAXAGE_DEFAULT

#define LRO_FASTESTMIRRORMAXAGE_DEFAULT   2592000L

LRO_FASTESTMIRRORMAXAGE default value

Definition at line 48 of file handle.h.

◆ LRO_FASTESTMIRRORMAXAGE_MIN

#define LRO_FASTESTMIRRORMAXAGE_MIN   0L

LRO_FASTESTMIRRORMAXAGE minimal allowed value

Definition at line 51 of file handle.h.

◆ LRO_FASTESTMIRRORTIMEOUT_DEFAULT

#define LRO_FASTESTMIRRORTIMEOUT_DEFAULT   2.0

LRO_FASTESTMIRRORTIMEOUT default value

Definition at line 111 of file handle.h.

◆ LRO_FTPUSEEPSV_DEFAULT

#define LRO_FTPUSEEPSV_DEFAULT   1L

LRO_FTPUSEEPSV default value

Definition at line 123 of file handle.h.

◆ LRO_GNUPGHOMEDIR_DEFAULT

#define LRO_GNUPGHOMEDIR_DEFAULT   NULL

LRO_GNUPGHOMEDIR default value

Definition at line 108 of file handle.h.

◆ LRO_HTTPAUTHMETHODS_DEFAULT

#define LRO_HTTPAUTHMETHODS_DEFAULT   LR_AUTH_BASIC

LRO_HTTPAUTHMETHODS default value

Definition at line 117 of file handle.h.

◆ LRO_IPRESOLVE_DEFAULT

#define LRO_IPRESOLVE_DEFAULT   LR_IPRESOLVE_WHATEVER

LRO_IPRESOLVE default value

Definition at line 99 of file handle.h.

◆ LRO_LOWSPEEDLIMIT_DEFAULT

#define LRO_LOWSPEEDLIMIT_DEFAULT   1000L

LRO_LOWSPEEDLIMIT default value

Definition at line 96 of file handle.h.

◆ LRO_LOWSPEEDLIMIT_MIN

#define LRO_LOWSPEEDLIMIT_MIN   0L

LRO_LOWSPEEDLIMIT minimal allowed value

Definition at line 93 of file handle.h.

◆ LRO_LOWSPEEDTIME_DEFAULT

#define LRO_LOWSPEEDTIME_DEFAULT   30L

LRO_LOWSPEEDTIME default value

Definition at line 90 of file handle.h.

◆ LRO_LOWSPEEDTIME_MIN

#define LRO_LOWSPEEDTIME_MIN   0L

LRO_LOWSPEEDTIME minimal allowed value

Definition at line 87 of file handle.h.

◆ LRO_MAXDOWNLOADSPERMIRROR_DEFAULT

#define LRO_MAXDOWNLOADSPERMIRROR_DEFAULT   3L

LRO_MAXDOWNLOADSPERMIRROR default value

Definition at line 81 of file handle.h.

◆ LRO_MAXDOWNLOADSPERMIRROR_MIN

#define LRO_MAXDOWNLOADSPERMIRROR_MIN   1L

LRO_MAXDOWNLOADSPERMIRROR minimal allowed value

Definition at line 84 of file handle.h.

◆ LRO_MAXMIRRORTRIES_DEFAULT

#define LRO_MAXMIRRORTRIES_DEFAULT   0L

LRO_MAXMIRRORTRIES default value

Definition at line 66 of file handle.h.

◆ LRO_MAXMIRRORTRIES_MIN

#define LRO_MAXMIRRORTRIES_MIN   0L

LRO_MAXMIRRORTRIES minimal allowed value

Definition at line 69 of file handle.h.

◆ LRO_MAXPARALLELDOWNLOADS_DEFAULT

#define LRO_MAXPARALLELDOWNLOADS_DEFAULT   3L

LRO_MAXPARALLELDOWNLOADS default value

Definition at line 72 of file handle.h.

◆ LRO_MAXPARALLELDOWNLOADS_MAX

#define LRO_MAXPARALLELDOWNLOADS_MAX   20L

LRO_MAXPARALLELDOWNLOADS maximal allowed value

Definition at line 78 of file handle.h.

◆ LRO_MAXPARALLELDOWNLOADS_MIN

#define LRO_MAXPARALLELDOWNLOADS_MIN   1L

LRO_MAXPARALLELDOWNLOADS minimal allowed value

Definition at line 75 of file handle.h.

◆ LRO_MAXSPEED_DEFAULT

#define LRO_MAXSPEED_DEFAULT   G_GINT64_CONSTANT(0)

LRO_MAXSPEED default value (0 == unlimited speed)

Definition at line 60 of file handle.h.

◆ LRO_OFFLINE_DEFAULT

#define LRO_OFFLINE_DEFAULT   0L

LRO_OFFLINE default value

Definition at line 114 of file handle.h.

◆ LRO_PROXYAUTHMETHODS_DEFAULT

#define LRO_PROXYAUTHMETHODS_DEFAULT   LR_AUTH_BASIC

LRO_PROXYAUTHMETHODS default value

Definition at line 120 of file handle.h.

◆ LRO_PROXYPORT_DEFAULT

#define LRO_PROXYPORT_DEFAULT   1080L

LRO_PROXYPORT default value

Definition at line 54 of file handle.h.

◆ LRO_PROXYTYPE_DEFAULT

#define LRO_PROXYTYPE_DEFAULT   LR_PROXY_HTTP

LRO_PROXYTYPE default value

Definition at line 57 of file handle.h.

Typedef Documentation

◆ LrHandle

typedef struct _LrHandle LrHandle

Handle object containing configuration for repository metadata and package downloading.

Definition at line 39 of file handle.h.

Enumeration Type Documentation

◆ LrHandleInfoOption

Handle options for the lr_handle_getinfo function.

Enumerator
LRI_UPDATE 

(long *)

LRI_URLS 

(char *** Malloced) NOTE: Returned list must be freed as well as all its items! You could use g_strfreev() function.

LRI_MIRRORLIST 

(char **)

LRI_MIRRORLISTURL 

(char **)

LRI_METALINKURL 

(char **)

LRI_LOCAL 

(long *)

LRI_PROGRESSCB 

(void *)

LRI_PROGRESSDATA 

(LrProgressCb)

LRI_DESTDIR 

(char **)

LRI_REPOTYPE 

(long *)

LRI_USERAGENT 

(char **)

LRI_YUMDLIST 

(char *** Malloced) NOTE: Returned list must be freed as well as all its items! You could use g_strfreev() function.

LRI_YUMBLIST 

(char *** Malloced) NOTE: Returned list must be freed as well as all its items! You could use g_strfreev() function.

LRI_FETCHMIRRORS 

(long *)

LRI_MAXMIRRORTRIES 

(long *)

LRI_VARSUB 

(LrUrlVars **)

LRI_MIRRORS 

(char *** Malloced) Mirrorlist associated with the repository.

Mirrors on this list are mirrors parsed from mirrorlist/metalink specified by LRO_MIRRORLIST or from mirrorlist specified by LRO_MIRROSLISTURL and metalink specified by LRO_METALINKURL.

No URLs specified by LRO_URLS are included in this list.

NOTE: Returned list must be freed as well as all its items! You could use g_strfreev() function.

LRI_METALINK 

(LrMetalink *)

LRI_FASTESTMIRROR 

(long *)

LRI_FASTESTMIRRORCACHE 

(char **)

LRI_FASTESTMIRRORMAXAGE 

(long *)

LRI_HMFCB 

(LrHandleMirrorFailureCb)

LRI_SSLVERIFYPEER 

(long *)

LRI_SSLVERIFYHOST 

(long *)

LRI_IPRESOLVE 

(LrIpResolveType *)

LRI_ALLOWEDMIRRORFAILURES 

(long *)

LRI_ADAPTIVEMIRRORSORTING 

(long *)

LRI_GNUPGHOMEDIR 

(char **)

LRI_FASTESTMIRRORTIMEOUT 

(double *)

LRI_HTTPHEADER 

(char *** Malloced) NOTE: Returned list must be freed as well as all its items! You could use g_strfreev() function.

LRI_OFFLINE 

(long *)

LRI_SSLCLIENTCERT 

(char **)

LRI_SSLCLIENTKEY 

(char **)

LRI_SSLCACERT 

(char **)

LRI_LOWSPEEDTIME 

(long)

LRI_LOWSPEEDLIMIT 

(long)

LRI_HTTPAUTHMETHODS 

(LrAuth)

LRI_PROXYAUTHMETHODS 

(LrAuth)

LRI_FTPUSEEPSV 

(long)

LRI_YUMSLIST 

(LrUrlVars **)

LRI_CACHEDIR 

(char *)

LRI_SSLVERIFYSTATUS 

(long *)

LRI_PROXY_SSLVERIFYPEER 

(long *)

LRI_PROXY_SSLVERIFYHOST 

(long *)

LRI_PROXY_SSLCLIENTCERT 

(char **)

LRI_PROXY_SSLCLIENTKEY 

(char **)

LRI_PROXY_SSLCACERT 

(char **)

Definition at line 448 of file handle.h.

◆ LrHandleOption

Handle options for the lr_handle_setopt function.

Enumerator
LRO_UPDATE 

(long 1 or 0) Update existing repo in LrResult. Update means download missing (previously omitted) metadata file(s).

LRO_URLS 

(char ** NULL-terminated) List of base repo URLs

LRO_MIRRORLIST 

(char *) Mirrorlist or metalink url. This option is DEPRECATED! Use LRO_MIRRORLISTURL or LRO_METALINKURL instead.

LRO_MIRRORLISTURL 

(char *) Mirrorlist url

LRO_METALINKURL 

(char *) Metalink url

LRO_LOCAL 

(long 1 or 0) Do not duplicate local metadata, just locate the old one

LRO_HTTPAUTH 

(long 1 or 0) Enable all supported method of HTTP authentication. This option is DEPRECATED! Use LRO_HTTPAUTHMETHODS

LRO_USERPWD 

(char *) User and password for HTTP authentication in format user:password. The user and password strings are not URL decoded, so there is no way to send in a username containing a colon using this option. The option is DEPRECATED! Use LRO_USERNAME and LRO_PASSWORD

LRO_PROXY 

(char *) Address of proxy server eg. "proxy-host.com:8080"

LRO_PROXYPORT 

(long) Set port number for proxy separately. Default port is 1080.

LRO_PROXYTYPE 

(LrProxyType) Type of the proxy used.

LRO_PROXYAUTH 

(long 1 or 0) Enable all supported method for proxy authentication. This option is DEPRECATED! Use LRO_PROXYAUTHMETHODS

LRO_PROXYUSERPWD 

(char *) User and password for proxy in format user:password Both the username and the password are URL decoded before use, so if the username contains, for example, a colon, it should be encoded as %3A.

LRO_PROGRESSCB 

(LrProgressCb) Progress callback

LRO_PROGRESSDATA 

(void *) Progress callback user data

LRO_MAXSPEED 

(gint64) Maximum download speed in bytes per second. Default is 0 = unlimited download speed.

LRO_DESTDIR 

(char *) Where to save downloaded files

LRO_REPOTYPE 

(LrRepotype) Type of downloaded repo, currently only supported is LR_YUMREPO.

LRO_CONNECTTIMEOUT 

(long) Max time in sec for connection phase. default timeout is 300 seconds.

LRO_IGNOREMISSING 

(long 1 or 0) If you want to localise (LRO_LOCAL is enabled) a incomplete local repository (eg. only primary and filelists are present) you could use LRO_YUMDLIST and specify only file that are present, or use this option.

LRO_INTERRUPTIBLE 

(long 1 or 0) If true, Librepo setups its own signal handler for SIGTERM and stops downloading if SIGTERM is catched. In this case current operation could return any kind of error code. Handle which operation was interrupted should never be used again!

LRO_USERAGENT 

(char *) String for User-Agent: header in the http request sent to the remote server

LRO_FETCHMIRRORS 

(long 1 or 0) If true - do not download anything, except mirrorlist or metalink (during lr_handle_perform()).

LRO_MAXMIRRORTRIES 

(long) If download fails try at most the specified number of mirrors. 0 means try all available mirrors.

LRO_MAXPARALLELDOWNLOADS 

(long) Maximum number of parallel downloads.

LRO_MAXDOWNLOADSPERMIRROR 

(long) Maximum number of parallel downloads per mirror.

LRO_VARSUB 

(LrUrlVars *) Variables and its substitutions for repo URL. [{"releasever", "f18"}], ...; (e.g.: http://foo/$releasever => http://foo/f18) LrUrlVars has to be constructed by the lr_urlvars_set() function. After set the list to the handle, it has not to be freed! Handle itself takes care about freeing the list.

LRO_FASTESTMIRROR 

(long 1 or 0) Sort the internal mirrorlist, after it is constructed, by the determined connection speed. Disabled by default.

LRO_FASTESTMIRRORCACHE 

(char *) Path to the fastestmirror's cache file. Used when LRO_FASTESTMIRROR is enabled. If it doesn't exists, it will be created.

LRO_GPGCHECK 

(long 1 or 0) Check GPG signature if available

LRO_CHECKSUM 

(long 1 or 0) Check files checksum if available

LRO_YUMDLIST 

(char ** NULL-terminated) Download only specified records from repomd (e.g. ["primary", "filelists", NULL]). Note: Last element of the list must be NULL!

LRO_YUMBLIST 

(char ** NULL-terminated) Do not download this specified records from repomd (skiplist). Note: Last element of the list must be NULL!

LRO_HMFCB 

(LrHandleMirrorFailureCb) Handle specific mirror failure callback. Callback called when a repodata download from a mirror fails. This callback gets the user data set by LRO_PROGRESSDATA

LRO_SSLVERIFYPEER 

(long 1 or 0) This option determines whether librepo verifies the authenticity of the peer's certificate. This trust is based on a chain of digital signatures, rooted in certification authority (CA) certificates.

LRO_SSLVERIFYHOST 

(long 1 or 0) This option determines whether librepo verifies that the server cert is for the server it is known as.

LRO_IPRESOLVE 

(LrIpResolveType) Sets what kind of IP addresses to use when resolving host names.

LRO_ALLOWEDMIRRORFAILURES 

(long) If all transfers from a mirror failed (no successful transfer from the mirror exists) and the number of failed downloads is higher or equal to this value the mirror will be skipped (ignored) for all next downloads. Note: Number of failed transfers for a single mirror can outreach this number! For example, if you set this value to 1 but you allow 3 parallel downloads it is possible that all three downloads start from the mirror, before any of them can fail. Then, if all three transfers fail, the number of failures for the mirror will be 3, even if this option was set to 1. Set -1 or 0 to disable this option

LRO_ADAPTIVEMIRRORSORTING 

(long 1 or 0) If enabled, internal list of mirrors for each handle is re-sorted after each finished transfer. The the sorting is based on mirror error rate etc.

LRO_GNUPGHOMEDIR 

(char *) Configuration directory for GNUPG (a directory with keyring)

LRO_FASTESTMIRRORTIMEOUT 

(double) Max length of fastest mirror measurement in seconds. Default value is 2sec

LRO_HTTPHEADER 

(char ** NULL-terminated) List of HTTP header to pass to the server and/or proxy in Librepo's HTTP requests.

LRO_OFFLINE 

(long 1 or 0) Make the handle work only locally, all remote URLs are ignored. Remote mirrorlists/metalinks (if they are specified) are ignored. Fastest mirror check (if enabled) is skipped.

LRO_SSLCLIENTCERT 

(char *) Path to the PEM format SSL client certificate librepo should use when talking to the server.

LRO_SSLCLIENTKEY 

(char *) Path to the PEM format SSL client key librepo should use when talking to the server, if not included in the client certificate file.

LRO_SSLCACERT 

(char *) Path to a file containing the list of PEM format trusted CA certificates.

LRO_HTTPAUTHMETHODS 

(LrAuth) Bitmask which tell Librepo which auth methods you wan to use.

LRO_PROXYAUTHMETHODS 

(LrAuth) A long bitmask which tell Librepo which auth methods you want to use for proxy auth.

LRO_FTPUSEEPSV 

(long 1 or 0) Enable/Disable EPSV (Extended Passive mode) for FTP.

LRO_YUMSLIST 

(LrUrlVars *) Repomd records and their substitutions. [{"group_gz", "group"}], ...; If var record is not listed in repomd, librepo will download val instead. After set the list to the handle, it has not to be freed! Handle itself takes care about freeing the list.

LRO_CACHEDIR 

(char *) Path to base cache directory for repositories, used by zchunk to find old files to copy data from. If this is NULL, zchunk will be disabled

LRO_PRESERVETIME 

(long 1 or 0) If enabled, librepo will try to keep timestamps of the downloaded files in sync with that on the remote side.

LRO_ONETIMEFLAG 

(char *) A one-time flag is a URL query parameter (in the form "key=value") that is added to the first HTTP request for LRO_METALINKURL or LRO_MIRRORLIST (whichever comes first) made with this handle. Any subsequent requests with this handle, including any retry attempts made by librepo internally, will not get the flag.

This is useful for implementing a mechanism for counting the users of a repository (and, by extension, of the OS as a whole) in which all flags received by the server in a specific time period are summed up to produce a good estimate, with the advantage of bundling the flag into regular metadata updates and not sending separate requests just for that purpose alone.

The guarantee is that, once set on this handle, the flag will only be used once and then thrown away (set to NULL). The program may choose to implement a sliding time window used to set this option on a regular basis (such as once per week), to allow for gathering usage statistics over time.

For a reference implementation, see the "countme" option in dnf.conf(5) or the associated Fedora change: https://fedoraproject.org/wiki/Changes/DNF_Better_Counting

LRO_SSLVERIFYSTATUS 

(long 1 or 0) This option determines whether librepo verifies the status of the server cert using the 'Certificate Status Request' TLS extension (aka. OCSP stapling). Note that if this option is enabled but the server does not support the TLS extension, the verification will fail.

LRO_PROXY_SSLVERIFYPEER 

(long 1 or 0) This option determines whether librepo verifies the authenticity of the proxy certificate. This trust is based on a chain of digital signatures, rooted in certification authority (CA) certificates.

LRO_PROXY_SSLVERIFYHOST 

(long 1 or 0) This option determines whether librepo verifies the name of the proxy certificate against the host.

LRO_PROXY_SSLCLIENTCERT 

(char *) Path to the PEM format SSL client certificate librepo should use when talking to the proxy.

LRO_PROXY_SSLCLIENTKEY 

(char *) Path to the PEM format SSL client key librepo should use when talking to the proxy, if not included in the client certificate file.

LRO_PROXY_SSLCACERT 

(char *) Path to a file containing the list of PEM format trusted CA certificates. Used for proxy.

LRO_USERNAME 

(char *) User for HTTP authentication

LRO_PASSWORD 

(char *) Password for HTTP authentication

LRO_SENTINEL 

Sentinel

Definition at line 127 of file handle.h.

Function Documentation

◆ lr_handle_free()

void lr_handle_free ( LrHandle handle)

Frees handle and its content.

Parameters
handleHandle.

◆ lr_handle_getinfo()

gboolean lr_handle_getinfo ( LrHandle handle,
GError **  err,
LrHandleInfoOption  option,
  ... 
)

Get information from handle. Most of returned pointers point directly to the handle internal values and therefore you should assume that they are only valid until any manipulation (lr_handle_setopt, lr_handle_perform, ...) with handle occurs. NOTE: You should not free or modify the memory returned by this function unless it is explicitly mentioned!

Parameters
handleLibrepo handle.
errGError **
optionOption from LrHandleInfoOption enum.
...Appropriate variable for the selected option.
Returns
TRUE if everything is ok, FALSE if err is set.

◆ lr_handle_init()

LrHandle * lr_handle_init ( void  )

Return new handle.

Returns
New allocated handle.

◆ lr_handle_network_wait()

gboolean lr_handle_network_wait ( LrHandle handle,
GError **  err,
guint  seconds,
GCancellable *  cancellable 
)

Handle waiting on network for LRO_URLS.

Parameters
handleLibrepo handle.
secondsNetwork timeout seconds
errGError **
cancellableGCancellable *
Returns
TRUE if everything is ok, FALSE if err is set.

◆ lr_handle_perform()

gboolean lr_handle_perform ( LrHandle handle,
LrResult result,
GError **  err 
)

Perform repodata download or location.

Parameters
handleLibrepo handle.
resultLibrepo result.
errGError **
Returns
TRUE if everything is ok, FALSE if err is set.

◆ lr_handle_setopt()

gboolean lr_handle_setopt ( LrHandle handle,
GError **  err,
LrHandleOption  option,
  ... 
)

Set option (LrHandleOption) of the handle.

Parameters
handleHandle.
errGError **
optionOption from LrHandleOption enum.
...Value for the option.
Returns
TRUE if everything is ok, FALSE if err is set.