MUtilities development repository
修订版 | cdd7be04098dadebf38b22b2fedea3ac1af44366 (tree) |
---|---|
时间 | 2015-08-25 04:49:15 |
作者 | ![]() |
Commiter | LoRd_MuldeR |
Updated list of known hosts.
@@ -122,7 +122,8 @@ namespace MUtils | ||
122 | 122 | inline void setProgress(const int progress); |
123 | 123 | inline void log(const QString &str1, const QString &str2 = QString(), const QString &str3 = QString(), const QString &str4 = QString()); |
124 | 124 | |
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); | |
126 | 127 | bool getUpdateInfo(const QString &url, const QString &outFileVers, const QString &outFileSign); |
127 | 128 | int tryContactHost(const QString &url); |
128 | 129 | bool tryUpdateMirror(UpdateCheckerInfo *updateInfo, const QString &url); |
@@ -76,14 +76,17 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites | ||
76 | 76 | "http://www.163.com/", |
77 | 77 | "http://www.7-zip.org/", |
78 | 78 | "http://www.ac3filter.net/", |
79 | - "http://www.amazon.com/", | |
79 | + "http://clbianco.altervista.org/", | |
80 | + "http://status.aws.amazon.com/", | |
80 | 81 | "http://antergos.com/", |
81 | 82 | "http://www.aol.com/", |
82 | 83 | "http://www.apache.org/", |
83 | 84 | "http://www.apple.com/", |
84 | 85 | "http://www.adobe.com/", |
86 | + "http://archive.org/web/", | |
87 | + "http://www.artlebedev.ru/", | |
85 | 88 | "http://web.audacityteam.org/", |
86 | - "http://automattic.com/", | |
89 | + "http://status.automattic.com/", | |
87 | 90 | "http://www.avidemux.org/", |
88 | 91 | "http://www.babylon.com/", |
89 | 92 | "http://www.baidu.com/", |
@@ -91,15 +94,19 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites | ||
91 | 94 | "http://www.bbc.co.uk/", |
92 | 95 | "http://www.berlios.de/", |
93 | 96 | "http://www.bing.com/", |
97 | + "http://www.bingeandgrab.com/", | |
94 | 98 | "http://www.bucketheadpikes.com/", |
99 | + "http://www.buckethead-coop.com/", | |
95 | 100 | "http://www.ccc.de/", |
96 | 101 | "http://www.citizeninsomniac.com/WMV/", |
97 | 102 | "http://www.cnet.com/", |
98 | 103 | "http://cnzz.com/", |
99 | 104 | "http://www.codeplex.com/", |
105 | + "http://www.codeproject.com/", | |
100 | 106 | "http://www.der-postillon.com/", |
101 | 107 | "http://www.ebay.com/", |
102 | 108 | "http://www.equation.com/", |
109 | + "http://www.farbrausch.de/", | |
103 | 110 | "http://fc2.com/", |
104 | 111 | "http://fedoraproject.org/wiki/Fedora_Project_Wiki", |
105 | 112 | "http://blog.fefe.de/", |
@@ -107,7 +114,7 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites | ||
107 | 114 | "http://blog.flickr.net/en", |
108 | 115 | "http://free-codecs.com/", |
109 | 116 | "http://git-scm.com/", |
110 | - "http://status.gitlab.com/", | |
117 | + "http://doc.gitlab.com/", | |
111 | 118 | "http://www.gmx.net/", |
112 | 119 | "http://news.gnome.org/", |
113 | 120 | "http://www.gnu.org/", |
@@ -121,6 +128,7 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites | ||
121 | 128 | "http://www.imgburn.com/", |
122 | 129 | "http://imgur.com/", |
123 | 130 | "http://www.jd.com/contact/", |
131 | + "http://www.jiscdigitalmedia.ac.uk/", | |
124 | 132 | "http://kannmanumdieuhrzeitschonnbierchentrinken.de/", |
125 | 133 | "http://mirrors.kernel.org/", |
126 | 134 | "http://komisar.gin.by/", |
@@ -130,28 +138,37 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites | ||
130 | 138 | "http://www.linuxmint.com/", |
131 | 139 | "http://www.livedoor.com/", |
132 | 140 | "http://www.livejournal.com/", |
141 | + "http://longplayer.org/", | |
133 | 142 | "http://go.mail.ru/", |
143 | + "http://marknelson.us/", | |
134 | 144 | "http://www.mediafire.com/about/", |
145 | + "http://www.mod-technologies.com/", | |
135 | 146 | "http://ftp.mozilla.org/", |
136 | 147 | "http://mplayerhq.hu/", |
137 | 148 | "http://www.msn.com/en-us/", |
138 | 149 | "http://wiki.multimedia.cx/", |
139 | 150 | "http://www.nch.com.au/", |
140 | 151 | "http://oss.netfarm.it/", |
152 | + "http://netrenderer.de/", | |
141 | 153 | "http://www.nytimes.com/", |
142 | 154 | "http://www.opera.com/", |
143 | 155 | "http://www.partha.com/", |
156 | + "http://pastebin.com/", | |
144 | 157 | "http://pastie.org/", |
158 | + "http://portableapps.com/about", | |
145 | 159 | "http://www.portablefreeware.com/", |
146 | 160 | "http://www.qt.io/", |
147 | 161 | "http://www.quakelive.com/", |
162 | + "http://rationalqm.us/mine.html", | |
148 | 163 | "http://www.seamonkey-project.org/", |
164 | + "http://selfhtml.org/", | |
149 | 165 | "http://www.shspvr.com/", |
150 | 166 | "http://www.sina.com.cn/", |
151 | 167 | "http://www.sohu.com/", |
152 | 168 | "http://www.sogou.com/", |
153 | 169 | "http://sourceforge.net/", |
154 | 170 | "http://www.spiegel.de/", |
171 | + "http://www.sputnikmusic.com/", | |
155 | 172 | "http://stackoverflow.com/", |
156 | 173 | "http://tdm-gcc.tdragon.net/", |
157 | 174 | "http://www.tdrsmusic.com/", |
@@ -161,16 +178,17 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites | ||
161 | 178 | "http://www.videolan.org/", |
162 | 179 | "http://virtualdub.org/", |
163 | 180 | "http://blog.virustotal.com/", |
164 | - "http://www.warr.org/buckethead.html", | |
181 | + "http://www.vkgoeswild.com/", | |
182 | + "http://www.warr.org/WAhere.html", | |
165 | 183 | "http://www.weibo.com/login.php", |
166 | 184 | "http://status.wikimedia.org/", |
167 | 185 | "http://www.winamp.com/", |
186 | + "http://www.winhoros.de/", | |
168 | 187 | "http://wpde.org/", |
169 | 188 | "http://x265.org/", |
170 | 189 | "http://xhmikosr.1f0.de/", |
171 | 190 | "http://xiph.org/", |
172 | 191 | "http://us.mail.yahoo.com/", |
173 | - "http://www.yandex.ru/", | |
174 | 192 | "http://www.youtube.com/yt/about/", |
175 | 193 | "http://www.zedo.com/", |
176 | 194 | "http://ffmpeg.zeranoe.com/", |
@@ -531,7 +549,19 @@ bool UpdateChecker::getUpdateInfo(const QString &url, const QString &outFileVers | ||
531 | 549 | return true; |
532 | 550 | } |
533 | 551 | |
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) | |
535 | 565 | { |
536 | 566 | QFileInfo output(outFile); |
537 | 567 | output.setCaching(false); |
@@ -550,6 +580,11 @@ bool UpdateChecker::getFile(const QString &url, const QString &outFile, unsigned | ||
550 | 580 | init_process(process, output.absolutePath()); |
551 | 581 | |
552 | 582 | QStringList args; |
583 | + if(forceIp4) | |
584 | + { | |
585 | + args << "-4"; | |
586 | + } | |
587 | + | |
553 | 588 | args << "-T" << "15" << "--no-cache" << "--no-dns-cache" << QString().sprintf("--max-redirect=%u", maxRedir); |
554 | 589 | args << QString("--referer=%1://%2/").arg(QUrl(url).scheme(), QUrl(url).host()) << "-U" << USER_AGENT_STR; |
555 | 590 | args << "-O" << output.fileName() << url; |
@@ -561,7 +596,6 @@ bool UpdateChecker::getFile(const QString &url, const QString &outFile, unsigned | ||
561 | 596 | |
562 | 597 | QTimer timer; |
563 | 598 | timer.setSingleShot(true); |
564 | - timer.setInterval(25000); | |
565 | 599 | connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); |
566 | 600 | |
567 | 601 | const QRegExp httpResponseOK("200 OK$"); |
@@ -573,7 +607,7 @@ bool UpdateChecker::getFile(const QString &url, const QString &outFile, unsigned | ||
573 | 607 | return false; |
574 | 608 | } |
575 | 609 | |
576 | - timer.start(); | |
610 | + timer.start(25000); | |
577 | 611 | |
578 | 612 | while(process.state() != QProcess::NotRunning) |
579 | 613 | { |