2021-07-16 Fred Gleason <fredg@paravelsystems.com>

* Modified the error dialogs in rdadmin(1) to make it possible
	to create a new RSS feed even with an inoperable upload URL.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-07-16 14:50:52 -04:00
parent a99dc99d28
commit 8289db9f9e
6 changed files with 42 additions and 14 deletions

View File

@@ -377,7 +377,8 @@ bool Xport::PostRssElemental(RDFeed *feed,const QDateTime &now,QString *err_msg)
rda->station()->sshIdentityFile().toUtf8().constData());
curl_easy_setopt(curl,CURLOPT_KEYPASSWD,
feed->purgePassword().toUtf8().constData());
*err_msg+="using ssh key at \""+rda->station()->sshIdentityFile()+"\" ";
rda->syslog(LOG_DEBUG,"using ssh key at \"%s\"",
rda->station()->sshIdentityFile().toUtf8().constData());
}
else {
curl_easy_setopt(curl,CURLOPT_USERNAME,
@@ -386,6 +387,10 @@ bool Xport::PostRssElemental(RDFeed *feed,const QDateTime &now,QString *err_msg)
feed->purgePassword().toUtf8().constData());
}
// HACK HACK!!
curl_easy_setopt(curl,CURLOPT_SSL_VERIFYHOST,0); // Verify remote hostname
curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,0); // Verify remote certificate
//
// Transfer Parameters
//
@@ -397,7 +402,7 @@ bool Xport::PostRssElemental(RDFeed *feed,const QDateTime &now,QString *err_msg)
curl_easy_setopt(curl,CURLOPT_TIMEOUT,RD_CURL_TIMEOUT);
curl_easy_setopt(curl,CURLOPT_NOPROGRESS,1);
curl_easy_setopt(curl,CURLOPT_USERAGENT,
(const char *)rda->config()->userAgent().toUtf8());
rda->config()->userAgent().toUtf8().constData());
curl_easy_setopt(curl,CURLOPT_ERRORBUFFER,errstr);
//
@@ -407,19 +412,21 @@ bool Xport::PostRssElemental(RDFeed *feed,const QDateTime &now,QString *err_msg)
case CURLE_OK:
case CURLE_PARTIAL_FILE:
feed->setLastBuildDateTime(now);
rda->syslog(LOG_DEBUG,
"posted RSS XML to \"%s\"",
feed->feedUrl().toUtf8().constData());
ret=true;
break;
default:
rda->syslog(LOG_ERR,"RSS XML upload failed: curl error %d [%s]",
curl_err,curl_easy_strerror(curl_err));
*err_msg+=errstr;
ret=false;
break;
}
curl_easy_cleanup(curl);
rda->syslog(LOG_DEBUG,
"posted RSS XML to \"%s\"",feed->feedUrl().toUtf8().constData());
return ret;
}