"http://mulder.bplaced.net/",
"http://mulder.cwsurf.de/",
"http://mulder.6te.net/",
- "http://mulder.webuda.com/",
- "http://mulder.byethost13.com/",
- "http://muldersoft.kilu.de/",
- "http://mulder.pe.hu/",
- "http://muldersoft.square7.ch/", //"http://muldersoft.zxq.net/",
+ "http://mulder.webuda.com/", //"http://mulder.byethost13.com/",
+ "http://mulder.pe.hu/", //"http://muldersoft.kilu.de/",
+ "http://muldersoft.square7.ch/", //"http://muldersoft.zxq.net/",
"http://muldersoft.co.nf/",
"http://muldersoft.eu.pn/",
"http://lamexp.sourceforge.net/",
"http://www.163.com/",
"http://www.7-zip.org/",
"http://www.ac3filter.net/",
- "http://www.amazon.com/",
+ "http://clbianco.altervista.org/",
+ "http://status.aws.amazon.com/",
"http://antergos.com/",
"http://www.aol.com/",
"http://www.apache.org/",
"http://www.apple.com/",
"http://www.adobe.com/",
+ "http://archive.org/web/",
+ "http://www.artlebedev.ru/",
"http://web.audacityteam.org/",
- "http://automattic.com/",
+ "http://status.automattic.com/",
"http://www.avidemux.org/",
"http://www.babylon.com/",
"http://www.baidu.com/",
"http://www.bbc.co.uk/",
"http://www.berlios.de/",
"http://www.bing.com/",
+ "http://www.bingeandgrab.com/",
"http://www.bucketheadpikes.com/",
+ "http://www.buckethead-coop.com/",
"http://www.ccc.de/",
"http://www.citizeninsomniac.com/WMV/",
"http://www.cnet.com/",
"http://cnzz.com/",
"http://www.codeplex.com/",
+ "http://www.codeproject.com/",
"http://www.der-postillon.com/",
"http://www.ebay.com/",
"http://www.equation.com/",
+ "http://www.farbrausch.de/",
"http://fc2.com/",
"http://fedoraproject.org/wiki/Fedora_Project_Wiki",
"http://blog.fefe.de/",
"http://blog.flickr.net/en",
"http://free-codecs.com/",
"http://git-scm.com/",
- "http://status.gitlab.com/",
+ "http://doc.gitlab.com/",
"http://www.gmx.net/",
"http://news.gnome.org/",
"http://www.gnu.org/",
"http://www.imgburn.com/",
"http://imgur.com/",
"http://www.jd.com/contact/",
+ "http://www.jiscdigitalmedia.ac.uk/",
"http://kannmanumdieuhrzeitschonnbierchentrinken.de/",
"http://mirrors.kernel.org/",
"http://komisar.gin.by/",
"http://www.linuxmint.com/",
"http://www.livedoor.com/",
"http://www.livejournal.com/",
+ "http://longplayer.org/",
"http://go.mail.ru/",
+ "http://marknelson.us/",
"http://www.mediafire.com/about/",
+ "http://www.mod-technologies.com/",
"http://ftp.mozilla.org/",
"http://mplayerhq.hu/",
"http://www.msn.com/en-us/",
"http://wiki.multimedia.cx/",
"http://www.nch.com.au/",
"http://oss.netfarm.it/",
+ "http://netrenderer.de/",
"http://www.nytimes.com/",
"http://www.opera.com/",
"http://www.partha.com/",
+ "http://pastebin.com/",
"http://pastie.org/",
+ "http://portableapps.com/about",
"http://www.portablefreeware.com/",
"http://www.qt.io/",
"http://www.quakelive.com/",
+ "http://rationalqm.us/mine.html",
"http://www.seamonkey-project.org/",
+ "http://selfhtml.org/",
"http://www.shspvr.com/",
"http://www.sina.com.cn/",
"http://www.sohu.com/",
"http://www.sogou.com/",
"http://sourceforge.net/",
"http://www.spiegel.de/",
+ "http://www.sputnikmusic.com/",
"http://stackoverflow.com/",
"http://tdm-gcc.tdragon.net/",
"http://www.tdrsmusic.com/",
"http://www.videolan.org/",
"http://virtualdub.org/",
"http://blog.virustotal.com/",
- "http://www.warr.org/buckethead.html",
+ "http://www.vkgoeswild.com/",
+ "http://www.warr.org/WAhere.html",
"http://www.weibo.com/login.php",
"http://status.wikimedia.org/",
"http://www.winamp.com/",
+ "http://www.winhoros.de/",
"http://wpde.org/",
"http://x265.org/",
"http://xhmikosr.1f0.de/",
"http://xiph.org/",
"http://us.mail.yahoo.com/",
- "http://www.yandex.ru/",
"http://www.youtube.com/yt/about/",
"http://www.zedo.com/",
"http://ffmpeg.zeranoe.com/",
m_downloadAddress.clear();
m_downloadFilename.clear();
m_downloadFilecode.clear();
+ m_downloadChecksum.clear();
+}
+
+bool UpdateCheckerInfo::isComplete(void)
+{
+ if(this->m_buildNo < 1) return false;
+ if(this->m_buildDate.year() < 2010) return false;
+ if(this->m_downloadSite.isEmpty()) return false;
+ if(this->m_downloadAddress.isEmpty()) return false;
+ if(this->m_downloadFilename.isEmpty()) return false;
+ if(this->m_downloadFilecode.isEmpty()) return false;
+ if(this->m_downloadChecksum.isEmpty()) return false;
+
+ return true;
}
////////////////////////////////////////////////////////////
UpdateChecker::~UpdateChecker(void)
{
- delete m_updateInfo;
}
////////////////////////////////////////////////////////////
setProgress(m_progress + 1);
if(!m_success)
{
- if(tryUpdateMirror(m_updateInfo, currentMirror))
+ if(tryUpdateMirror(m_updateInfo.data(), currentMirror))
{
m_success = true;
}
bool UpdateChecker::getUpdateInfo(const QString &url, const QString &outFileVers, const QString &outFileSign)
{
log("", "Downloading update info:");
- if(!getFile(QString("%1%2" ).arg(url, mirror_url_postfix[m_betaUpdates ? 1 : 0]), outFileVers))
+ if(!getFile(QString("%1%2" ).arg(url, mirror_url_postfix[m_betaUpdates ? 1 : 0]), outFileVers))
{
return false;
}
log("", "Downloading signature:");
- if(!getFile(QString("%1%2.sig").arg(url, mirror_url_postfix[m_betaUpdates ? 1 : 0]), outFileSign))
+ if(!getFile(QString("%1%2.sig2").arg(url, mirror_url_postfix[m_betaUpdates ? 1 : 0]), outFileSign))
{
return false;
}
return true;
}
-bool UpdateChecker::getFile(const QString &url, const QString &outFile, unsigned int maxRedir, bool *httpOk)
+bool UpdateChecker::getFile(const QString &url, const QString &outFile, const unsigned int maxRedir, bool *httpOk)
+{
+ for(int i = 0; i < 2; i++)
+ {
+ if(getFile(url, (i > 0), outFile, maxRedir, httpOk))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool UpdateChecker::getFile(const QString &url, const bool forceIp4, const QString &outFile, const unsigned int maxRedir, bool *httpOk)
{
QFileInfo output(outFile);
output.setCaching(false);
init_process(process, output.absolutePath());
QStringList args;
+ if(forceIp4)
+ {
+ args << "-4";
+ }
+
args << "-T" << "15" << "--no-cache" << "--no-dns-cache" << QString().sprintf("--max-redirect=%u", maxRedir);
args << QString("--referer=%1://%2/").arg(QUrl(url).scheme(), QUrl(url).host()) << "-U" << USER_AGENT_STR;
args << "-O" << output.fileName() << url;
QTimer timer;
timer.setSingleShot(true);
- timer.setInterval(25000);
connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
const QRegExp httpResponseOK("200 OK$");
return false;
}
- timer.start();
+ timer.start(25000);
while(process.state() != QProcess::NotRunning)
{
return false;
}
+ QString keyRingPath(m_binaryKeys);
+ bool removeKeyring = false;
if(QFileInfo(file).absolutePath().compare(QFileInfo(m_binaryKeys).absolutePath(), Qt::CaseInsensitive) != 0)
{
- qWarning("CheckSignature: File and keyring should be in same folder!");
- return false;
+ keyRingPath = make_temp_file(QFileInfo(file).absolutePath(), "gpg");
+ removeKeyring = true;
+ if(!QFile::copy(m_binaryKeys, keyRingPath))
+ {
+ qWarning("CheckSignature: Failed to copy the key-ring file!");
+ return false;
+ }
}
QProcess process;
connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)), &loop, SLOT(quit()));
connect(&process, SIGNAL(readyRead()), &loop, SLOT(quit()));
- process.start(m_binaryGnuPG, QStringList() << "--homedir" << "." << "--keyring" << QFileInfo(m_binaryKeys).fileName() << QFileInfo(signature).fileName() << QFileInfo(file).fileName());
+ process.start(m_binaryGnuPG, QStringList() << "--homedir" << "." << "--keyring" << QFileInfo(keyRingPath).fileName() << QFileInfo(signature).fileName() << QFileInfo(file).fileName());
if(!process.waitForStarted())
{
+ if(removeKeyring)
+ {
+ remove_file(keyRingPath);
+ }
return false;
}
}
}
+ if(removeKeyring)
+ {
+ remove_file(keyRingPath);
+ }
+
log(QString().sprintf("Exited with code %d", process.exitCode()));
return (process.exitCode() == 0);
}
if(value.cap(1).compare("BuildNo", Qt::CaseInsensitive) == 0)
{
bool ok = false;
- unsigned int temp = value.cap(2).toUInt(&ok);
+ const unsigned int temp = value.cap(2).toUInt(&ok);
if(ok) updateInfo->m_buildNo = temp;
}
else if(value.cap(1).compare("BuildDate", Qt::CaseInsensitive) == 0)
{
- QDate temp = QDate::fromString(value.cap(2).trimmed(), Qt::ISODate);
+ const QDate temp = QDate::fromString(value.cap(2).trimmed(), Qt::ISODate);
if(temp.isValid()) updateInfo->m_buildDate = temp;
}
else if(value.cap(1).compare("DownloadSite", Qt::CaseInsensitive) == 0)
{
updateInfo->m_downloadFilecode = value.cap(2).trimmed();
}
+ else if(value.cap(1).compare("DownloadChecksum", Qt::CaseInsensitive) == 0)
+ {
+ updateInfo->m_downloadChecksum = value.cap(2).trimmed();
+ }
}
if(inHdr && (value.indexIn(line) >= 0))
{
log("Version info is from the future, take care!");
qWarning("Version info is from the future, take care!");
}
-
- bool complete = true;
-
- if(!(updateInfo->m_buildNo > 0)) complete = false;
- if(!(updateInfo->m_buildDate.year() >= 2010)) complete = false;
- if(updateInfo->m_downloadSite.isEmpty()) complete = false;
- if(updateInfo->m_downloadAddress.isEmpty()) complete = false;
- if(updateInfo->m_downloadFilename.isEmpty()) complete = false;
- if(updateInfo->m_downloadFilecode.isEmpty()) complete = false;
- if(!complete)
+ if(!updateInfo->isComplete())
{
log("WARNING: Version info is incomplete!");
+ return false;
}
- return complete;
+ return true;
}
////////////////////////////////////////////////////////////