mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 03:39:17 +01:00
Add option to select network interface for operations
This commit is contained in:
parent
97bb4d8923
commit
d83ba7ff30
@ -222,6 +222,7 @@ struct CurlConfig
|
||||
curl_off_t iDownloadRate;
|
||||
long int iLowSpeedTimeout;
|
||||
long int iLowSpeedTimeoutRate;
|
||||
std::string sInterface;
|
||||
};
|
||||
|
||||
class Config
|
||||
|
1
main.cpp
1
main.cpp
@ -292,6 +292,7 @@ int main(int argc, char *argv[])
|
||||
("check-free-space", bpo::value<bool>(&Globals::globalConfig.dlConf.bFreeSpaceCheck)->zero_tokens()->default_value(false), "Check for available free space before starting download")
|
||||
("no-fast-status-check", bpo::value<bool>(&bNoFastStatusCheck)->zero_tokens()->default_value(false), "Don't use fast status check.\nMakes --status much slower but able to catch corrupted files by calculating local file hash for all files.")
|
||||
("trust-api-for-extras", bpo::value<bool>(&Globals::globalConfig.bTrustAPIForExtras)->zero_tokens()->default_value(false), "Trust API responses for extras to be correct.")
|
||||
("interface", bpo::value<std::string>(&Globals::globalConfig.curlConf.sInterface)->default_value(""), "Perform operations using a specified network interface")
|
||||
;
|
||||
|
||||
options_cli_no_cfg_hidden.add_options()
|
||||
|
@ -453,6 +453,9 @@ local file hash for all files.
|
||||
.TP
|
||||
\fB\-\-trust\-api\-for\-extras\fR
|
||||
Trust API responses for extras to be correct.
|
||||
.TP
|
||||
\fB\-\-interface\fR arg
|
||||
Perform operations using a specified network interface
|
||||
.SS "Experimental:"
|
||||
.TP
|
||||
\fB\-\-galaxy\-install\fR arg
|
||||
|
@ -817,6 +817,12 @@ void Util::CurlHandleSetDefaultOptions(CURL* curlhandle, const CurlConfig& conf)
|
||||
|
||||
if (!conf.sCACertPath.empty())
|
||||
curl_easy_setopt(curlhandle, CURLOPT_CAINFO, conf.sCACertPath.c_str());
|
||||
|
||||
if (!conf.sInterface.empty())
|
||||
{
|
||||
curl_easy_setopt(curlhandle, CURLOPT_DNS_INTERFACE, conf.sInterface.c_str());
|
||||
curl_easy_setopt(curlhandle, CURLOPT_INTERFACE, conf.sInterface.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
std::string Util::CurlHandleGetInfoString(CURL* curlhandle, CURLINFO info)
|
||||
|
Loading…
Reference in New Issue
Block a user