libzypp 17.31.23
curlhelper_p.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------/
9*
10* This file contains private API, this might break at any time between releases.
11* You have been warned!
12*
13*/
14#ifndef ZYPP_MEDIA_PRIVATE_CURLHELPER_P_H_INCLUDED
15#define ZYPP_MEDIA_PRIVATE_CURLHELPER_P_H_INCLUDED
16
17#include <curl/curl.h>
18#include <zypp-core/Url.h>
19#include <zypp-curl/TransferSettings>
20
21#define EXPLICITLY_NO_PROXY "_none_"
22
23#undef CURLVERSION_AT_LEAST
24#define CURLVERSION_AT_LEAST(M,N,O) LIBCURL_VERSION_NUM >= ((((M)<<8)+(N))<<8)+(O)
25
26namespace zypp
27{
28 namespace env
29 {
34 const long & ZYPP_MEDIA_CURL_DEBUG();
35
38 } // namespace env
39} //namespace zypp
40
41//do not export
42namespace internal {
43
46void setupZYPP_MEDIA_CURL_DEBUG( CURL *curl );
47size_t log_redirects_curl( char *ptr, size_t size, size_t nmemb, void *userdata);
48
49
52
53void curlEscape( std::string & str_r, const char char_r, const std::string & escaped_r );
54std::string curlEscapedPath( std::string path_r );
55std::string curlUnEscape( std::string text_r );
56
58zypp::Url propagateQueryParams( zypp::Url url_r, const zypp::Url & template_r );
59
60}
61
62#endif //ZYPP_MEDIA_PRIVATE_CURLHELPER_P_H_INCLUDED
Url manipulation class.
Definition: Url.h:92
Holds transfer setting.
void fillSettingsFromUrl(const Url &url, media::TransferSettings &s)
Fills the settings structure using options passed on the url for example ?timeout=x&proxy=foo.
Definition: curlhelper.cc:177
size_t log_redirects_curl(char *ptr, size_t size, size_t nmemb, void *userdata)
Definition: curlhelper.cc:137
void globalInitCurlOnce()
Definition: curlhelper.cc:64
zypp::Url propagateQueryParams(zypp::Url url_r, const zypp::Url &template_r)
Definition: curlhelper.cc:394
std::string curlUnEscape(std::string text_r)
Definition: curlhelper.cc:360
void setupZYPP_MEDIA_CURL_DEBUG(CURL *curl)
Setup CURLOPT_VERBOSE and CURLOPT_DEBUGFUNCTION according to env::ZYPP_MEDIA_CURL_DEBUG.
Definition: curlhelper.cc:124
std::string curlEscapedPath(std::string path_r)
Definition: curlhelper.cc:355
void fillSettingsSystemProxy(const Url &url, media::TransferSettings &s)
Reads the system proxy configuration and fills the settings structure proxy information.
Definition: curlhelper.cc:325
Url clearQueryString(const Url &url)
Definition: curlhelper.cc:367
void curlEscape(std::string &str_r, const char char_r, const std::string &escaped_r)
Definition: curlhelper.cc:347
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
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2