mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
add http proxy support for yt
Conflicts: src/gui/proxyserver_setup.cpp src/neutrino.cpp src/system/httptool.cpp src/system/settings.h
This commit is contained in:
@@ -31,7 +31,9 @@
|
||||
#include <string>
|
||||
|
||||
#include <OpenThreads/ScopedLock>
|
||||
#include "settings.h"
|
||||
#include "set_threadname.h"
|
||||
#include <global.h>
|
||||
|
||||
#include "ytparser.h"
|
||||
#include "ytcache.h"
|
||||
@@ -127,6 +129,14 @@ bool cYTFeedParser::getUrl(std::string &url, std::string &answer, CURL *_curl_ha
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT);
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_NOSIGNAL, (long)1);
|
||||
|
||||
if(g_settings.softupdate_proxyserver != "") {
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_PROXY, g_settings.softupdate_proxyserver.c_str());
|
||||
if(g_settings.softupdate_proxyusername != "") {
|
||||
std::string tmp = g_settings.softupdate_proxyusername + ":" + g_settings.softupdate_proxypassword;
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_PROXYUSERPWD, tmp.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
char cerror[CURL_ERROR_SIZE];
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror);
|
||||
|
||||
@@ -159,6 +169,14 @@ bool cYTFeedParser::DownloadUrl(std::string &url, std::string &file, CURL *_curl
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT);
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_NOSIGNAL, (long)1);
|
||||
|
||||
if(g_settings.softupdate_proxyserver != "") {
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_PROXY, g_settings.softupdate_proxyserver.c_str());
|
||||
if(g_settings.softupdate_proxyusername != "") {
|
||||
std::string tmp = g_settings.softupdate_proxyusername + ":" + g_settings.softupdate_proxypassword;
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_PROXYUSERPWD, tmp.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
char cerror[CURL_ERROR_SIZE];
|
||||
curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror);
|
||||
|
||||
|
Reference in New Issue
Block a user