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

@ -22052,3 +22052,6 @@
2021-07-14 Fred Gleason <fredg@paravelsystems.com> 2021-07-14 Fred Gleason <fredg@paravelsystems.com>
* Modified the login dialog for rdadmin(1) to use persistent * Modified the login dialog for rdadmin(1) to use persistent
placement. placement.
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.

View File

@ -636,11 +636,13 @@ void EditFeed::okData()
RDUpload *u=new RDUpload(rda->config(),this); RDUpload *u=new RDUpload(rda->config(),this);
if((!d->urlIsSupported(feed_purge_url_edit->text()))|| if((!d->urlIsSupported(feed_purge_url_edit->text()))||
(!u->urlIsSupported(feed_purge_url_edit->text()))) { (!u->urlIsSupported(feed_purge_url_edit->text()))) {
QMessageBox::warning(this,"RDAdmin - "+tr("Error"), if(QMessageBox::warning(this,"RDAdmin - "+tr("Error"),
tr("Audio Upload URL has unsupported scheme!")); tr("Audio Upload URL has unsupported scheme!"),
delete d; QMessageBox::Yes,QMessageBox::No)!=QMessageBox::Yes) {
delete u; delete d;
return; delete u;
return;
}
} }
delete d; delete d;
delete u; delete u;

View File

@ -371,6 +371,14 @@ void EditCast::okData()
} }
if(!cast_feed->postXmlConditional("RDCastManager",this)) { if(!cast_feed->postXmlConditional("RDCastManager",this)) {
if(QMessageBox::warning(this,"RDAdmin - "+tr("Upload Error"),
tr("XML data upload failed!")+"\n\n"+
tr("Continue saving feed parameters anyway?"),
QMessageBox::Yes,QMessageBox::Yes)==
QMessageBox::Yes) {
done(true);
return;
}
return; return;
} }

View File

@ -99,6 +99,18 @@
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Upload Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>XML data upload failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Continue saving feed parameters anyway?</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ListCasts</name> <name>ListCasts</name>

View File

@ -772,10 +772,6 @@ New</source>
<source>Start Time:</source> <source>Start Time:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>[none]</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>RSS Feed:</source> <source>RSS Feed:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

View File

@ -377,7 +377,8 @@ bool Xport::PostRssElemental(RDFeed *feed,const QDateTime &now,QString *err_msg)
rda->station()->sshIdentityFile().toUtf8().constData()); rda->station()->sshIdentityFile().toUtf8().constData());
curl_easy_setopt(curl,CURLOPT_KEYPASSWD, curl_easy_setopt(curl,CURLOPT_KEYPASSWD,
feed->purgePassword().toUtf8().constData()); 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 { else {
curl_easy_setopt(curl,CURLOPT_USERNAME, 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()); 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 // 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_TIMEOUT,RD_CURL_TIMEOUT);
curl_easy_setopt(curl,CURLOPT_NOPROGRESS,1); curl_easy_setopt(curl,CURLOPT_NOPROGRESS,1);
curl_easy_setopt(curl,CURLOPT_USERAGENT, curl_easy_setopt(curl,CURLOPT_USERAGENT,
(const char *)rda->config()->userAgent().toUtf8()); rda->config()->userAgent().toUtf8().constData());
curl_easy_setopt(curl,CURLOPT_ERRORBUFFER,errstr); 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_OK:
case CURLE_PARTIAL_FILE: case CURLE_PARTIAL_FILE:
feed->setLastBuildDateTime(now); feed->setLastBuildDateTime(now);
rda->syslog(LOG_DEBUG,
"posted RSS XML to \"%s\"",
feed->feedUrl().toUtf8().constData());
ret=true; ret=true;
break; break;
default: default:
rda->syslog(LOG_ERR,"RSS XML upload failed: curl error %d [%s]",
curl_err,curl_easy_strerror(curl_err));
*err_msg+=errstr; *err_msg+=errstr;
ret=false; ret=false;
break; break;
} }
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
rda->syslog(LOG_DEBUG,
"posted RSS XML to \"%s\"",feed->feedUrl().toUtf8().constData());
return ret; return ret;
} }