• R/O
  • HTTP
  • SSH
  • HTTPS

MUtilities: 提交

MUtilities development repository


Commit MetaInfo

修订版cdd7be04098dadebf38b22b2fedea3ac1af44366 (tree)
时间2015-08-25 04:49:15
作者LoRd_MuldeR <mulder2@gmx....>
CommiterLoRd_MuldeR

Log Message

Updated list of known hosts.

更改概述

差异

--- a/include/MUtils/UpdateChecker.h
+++ b/include/MUtils/UpdateChecker.h
@@ -122,7 +122,8 @@ namespace MUtils
122122 inline void setProgress(const int progress);
123123 inline void log(const QString &str1, const QString &str2 = QString(), const QString &str3 = QString(), const QString &str4 = QString());
124124
125- bool getFile(const QString &url, const QString &outFile, unsigned int maxRedir = 5, bool *httpOk = NULL);
125+ bool getFile(const QString &url, const QString &outFile, const unsigned int maxRedir = 5U, bool *httpOk = NULL);
126+ bool getFile(const QString &url, const bool forceIp4, const QString &outFile, const unsigned int maxRedir, bool *httpOk);
126127 bool getUpdateInfo(const QString &url, const QString &outFileVers, const QString &outFileSign);
127128 int tryContactHost(const QString &url);
128129 bool tryUpdateMirror(UpdateCheckerInfo *updateInfo, const QString &url);
--- a/src/UpdateChecker.cpp
+++ b/src/UpdateChecker.cpp
@@ -76,14 +76,17 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites
7676 "http://www.163.com/",
7777 "http://www.7-zip.org/",
7878 "http://www.ac3filter.net/",
79- "http://www.amazon.com/",
79+ "http://clbianco.altervista.org/",
80+ "http://status.aws.amazon.com/",
8081 "http://antergos.com/",
8182 "http://www.aol.com/",
8283 "http://www.apache.org/",
8384 "http://www.apple.com/",
8485 "http://www.adobe.com/",
86+ "http://archive.org/web/",
87+ "http://www.artlebedev.ru/",
8588 "http://web.audacityteam.org/",
86- "http://automattic.com/",
89+ "http://status.automattic.com/",
8790 "http://www.avidemux.org/",
8891 "http://www.babylon.com/",
8992 "http://www.baidu.com/",
@@ -91,15 +94,19 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites
9194 "http://www.bbc.co.uk/",
9295 "http://www.berlios.de/",
9396 "http://www.bing.com/",
97+ "http://www.bingeandgrab.com/",
9498 "http://www.bucketheadpikes.com/",
99+ "http://www.buckethead-coop.com/",
95100 "http://www.ccc.de/",
96101 "http://www.citizeninsomniac.com/WMV/",
97102 "http://www.cnet.com/",
98103 "http://cnzz.com/",
99104 "http://www.codeplex.com/",
105+ "http://www.codeproject.com/",
100106 "http://www.der-postillon.com/",
101107 "http://www.ebay.com/",
102108 "http://www.equation.com/",
109+ "http://www.farbrausch.de/",
103110 "http://fc2.com/",
104111 "http://fedoraproject.org/wiki/Fedora_Project_Wiki",
105112 "http://blog.fefe.de/",
@@ -107,7 +114,7 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites
107114 "http://blog.flickr.net/en",
108115 "http://free-codecs.com/",
109116 "http://git-scm.com/",
110- "http://status.gitlab.com/",
117+ "http://doc.gitlab.com/",
111118 "http://www.gmx.net/",
112119 "http://news.gnome.org/",
113120 "http://www.gnu.org/",
@@ -121,6 +128,7 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites
121128 "http://www.imgburn.com/",
122129 "http://imgur.com/",
123130 "http://www.jd.com/contact/",
131+ "http://www.jiscdigitalmedia.ac.uk/",
124132 "http://kannmanumdieuhrzeitschonnbierchentrinken.de/",
125133 "http://mirrors.kernel.org/",
126134 "http://komisar.gin.by/",
@@ -130,28 +138,37 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites
130138 "http://www.linuxmint.com/",
131139 "http://www.livedoor.com/",
132140 "http://www.livejournal.com/",
141+ "http://longplayer.org/",
133142 "http://go.mail.ru/",
143+ "http://marknelson.us/",
134144 "http://www.mediafire.com/about/",
145+ "http://www.mod-technologies.com/",
135146 "http://ftp.mozilla.org/",
136147 "http://mplayerhq.hu/",
137148 "http://www.msn.com/en-us/",
138149 "http://wiki.multimedia.cx/",
139150 "http://www.nch.com.au/",
140151 "http://oss.netfarm.it/",
152+ "http://netrenderer.de/",
141153 "http://www.nytimes.com/",
142154 "http://www.opera.com/",
143155 "http://www.partha.com/",
156+ "http://pastebin.com/",
144157 "http://pastie.org/",
158+ "http://portableapps.com/about",
145159 "http://www.portablefreeware.com/",
146160 "http://www.qt.io/",
147161 "http://www.quakelive.com/",
162+ "http://rationalqm.us/mine.html",
148163 "http://www.seamonkey-project.org/",
164+ "http://selfhtml.org/",
149165 "http://www.shspvr.com/",
150166 "http://www.sina.com.cn/",
151167 "http://www.sohu.com/",
152168 "http://www.sogou.com/",
153169 "http://sourceforge.net/",
154170 "http://www.spiegel.de/",
171+ "http://www.sputnikmusic.com/",
155172 "http://stackoverflow.com/",
156173 "http://tdm-gcc.tdragon.net/",
157174 "http://www.tdrsmusic.com/",
@@ -161,16 +178,17 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites
161178 "http://www.videolan.org/",
162179 "http://virtualdub.org/",
163180 "http://blog.virustotal.com/",
164- "http://www.warr.org/buckethead.html",
181+ "http://www.vkgoeswild.com/",
182+ "http://www.warr.org/WAhere.html",
165183 "http://www.weibo.com/login.php",
166184 "http://status.wikimedia.org/",
167185 "http://www.winamp.com/",
186+ "http://www.winhoros.de/",
168187 "http://wpde.org/",
169188 "http://x265.org/",
170189 "http://xhmikosr.1f0.de/",
171190 "http://xiph.org/",
172191 "http://us.mail.yahoo.com/",
173- "http://www.yandex.ru/",
174192 "http://www.youtube.com/yt/about/",
175193 "http://www.zedo.com/",
176194 "http://ffmpeg.zeranoe.com/",
@@ -531,7 +549,19 @@ bool UpdateChecker::getUpdateInfo(const QString &url, const QString &outFileVers
531549 return true;
532550 }
533551
534-bool UpdateChecker::getFile(const QString &url, const QString &outFile, unsigned int maxRedir, bool *httpOk)
552+bool UpdateChecker::getFile(const QString &url, const QString &outFile, const unsigned int maxRedir, bool *httpOk)
553+{
554+ for(int i = 0; i < 2; i++)
555+ {
556+ if(getFile(url, (i > 0), outFile, maxRedir, httpOk))
557+ {
558+ return true;
559+ }
560+ }
561+ return false;
562+}
563+
564+bool UpdateChecker::getFile(const QString &url, const bool forceIp4, const QString &outFile, const unsigned int maxRedir, bool *httpOk)
535565 {
536566 QFileInfo output(outFile);
537567 output.setCaching(false);
@@ -550,6 +580,11 @@ bool UpdateChecker::getFile(const QString &url, const QString &outFile, unsigned
550580 init_process(process, output.absolutePath());
551581
552582 QStringList args;
583+ if(forceIp4)
584+ {
585+ args << "-4";
586+ }
587+
553588 args << "-T" << "15" << "--no-cache" << "--no-dns-cache" << QString().sprintf("--max-redirect=%u", maxRedir);
554589 args << QString("--referer=%1://%2/").arg(QUrl(url).scheme(), QUrl(url).host()) << "-U" << USER_AGENT_STR;
555590 args << "-O" << output.fileName() << url;
@@ -561,7 +596,6 @@ bool UpdateChecker::getFile(const QString &url, const QString &outFile, unsigned
561596
562597 QTimer timer;
563598 timer.setSingleShot(true);
564- timer.setInterval(25000);
565599 connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
566600
567601 const QRegExp httpResponseOK("200 OK$");
@@ -573,7 +607,7 @@ bool UpdateChecker::getFile(const QString &url, const QString &outFile, unsigned
573607 return false;
574608 }
575609
576- timer.start();
610+ timer.start(25000);
577611
578612 while(process.state() != QProcess::NotRunning)
579613 {
Show on old repository browser