mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-09 10:06:04 -05:00
Rework curl helpers
This commit is contained in:
@@ -174,21 +174,18 @@ static std::string getRemoteData(std::string &url)
|
||||
{
|
||||
std::string readBuffer;
|
||||
|
||||
if (switcher->curl && f_curl_setopt && f_curl_perform) {
|
||||
f_curl_setopt(switcher->curl, CURLOPT_URL, url.c_str());
|
||||
f_curl_setopt(switcher->curl, CURLOPT_WRITEFUNCTION,
|
||||
WriteCallback);
|
||||
f_curl_setopt(switcher->curl, CURLOPT_WRITEDATA, &readBuffer);
|
||||
switcher->curl.SetOpt(CURLOPT_URL, url.c_str());
|
||||
switcher->curl.SetOpt(CURLOPT_WRITEFUNCTION, WriteCallback);
|
||||
switcher->curl.SetOpt(CURLOPT_WRITEDATA, &readBuffer);
|
||||
|
||||
// Set timeout to at least one second
|
||||
int timeout = switcher->interval / 1000;
|
||||
if (timeout == 0) {
|
||||
timeout = 1;
|
||||
}
|
||||
f_curl_setopt(switcher->curl, CURLOPT_TIMEOUT, 1);
|
||||
|
||||
f_curl_perform(switcher->curl);
|
||||
// Set timeout to at least one second
|
||||
int timeout = switcher->interval / 1000;
|
||||
if (timeout == 0) {
|
||||
timeout = 1;
|
||||
}
|
||||
switcher->curl.SetOpt(CURLOPT_TIMEOUT, 1);
|
||||
switcher->curl.Perform();
|
||||
|
||||
return readBuffer;
|
||||
}
|
||||
|
||||
@@ -422,7 +419,7 @@ void AdvSceneSwitcher::setupFileTab()
|
||||
obs_module_text("AdvSceneSwitcher.fileTab.remoteFileWarning2"));
|
||||
ui->remoteFileWarningLabel->hide();
|
||||
|
||||
if (switcher->curl) {
|
||||
if (switcher->curl.Initialized()) {
|
||||
ui->libcurlWarning->setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user