Jacek Caban : download.inc.php: Use SourceForge auto-select for all appwiz.cpl downloads from recent Wine.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 4 05:41:10 CST 2015


Module: tools
Branch: master
Commit: 19fb458756ee4d96a24ff7926ff28f73f8e308a3
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=19fb458756ee4d96a24ff7926ff28f73f8e308a3

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Mar  4 12:09:02 2015 +0100

download.inc.php: Use SourceForge auto-select for all appwiz.cpl downloads from recent Wine.

---

 download.inc.php | 15 +++++++++++++++
 winegecko.php    | 14 --------------
 winemono.php     |  4 ----
 3 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/download.inc.php b/download.inc.php
index 06e5b81..17811a6 100644
--- a/download.inc.php
+++ b/download.inc.php
@@ -5,6 +5,21 @@
  * Copyright (c) 2006 Jonathan Ernst
  */
 
+// SourceForge can do better job at redirecting to the mirror than us. However,
+// it redirects to HTML page by default for web browser user agents. New enough
+// Wine set user agent to 'Wine Addon Downloader', so redirect them directly
+// to SourceForge. For older Wine and other user agents, fallback to random
+// known mirror.
+if(strcmp($_SERVER['HTTP_USER_AGENT'], 'Wine Addon Downloader') === 0) {
+    header("Location: http://sourceforge.net/projects/wine/files/".$sFileName);
+    exit;
+}
+
+if(!$iFileSize) {
+    header("HTTP/1.0 404 Not Found");
+    exit;
+}
+
 // List of common locations for files
 $aList += array("http://freefr.dl.sourceforge.net/project/wine/",
                 "http://heanet.dl.sourceforge.net/project/wine/",
diff --git a/winegecko.php b/winegecko.php
index e44b9e3..0e07406 100644
--- a/winegecko.php
+++ b/winegecko.php
@@ -48,16 +48,6 @@ default:
 // Name of the file
 $sFileName = sprintf('%s/%s/wine_gecko-%s.%s', $sFolder, $sVersion, $sFileSuffix, $sExt);
 
-// SourceForge can do better job at redirecting to the mirror than us. However,
-// it redirects to HTML page by default for web browser user agents. New enough
-// Wine set user agent to 'Wine Addon Downloader', so redirect them directly
-// to SourceForge. For older Wine and other user agents, fallback to random
-// known mirror.
-if(strcmp($_SERVER['HTTP_USER_AGENT'], 'Wine Addon Downloader') === 0) {
-    header("Location: http://sourceforge.net/projects/wine/files/".$sFileName);
-    exit;
-}
-
 // Size array
 $aFileSizes = array(
 	'0.0.1'=>5219822,
@@ -103,10 +93,6 @@ $aFileSizes = array(
 
 // Exact size of the file:
 $iFileSize = $aFileSizes[$sFileSuffix];
-if(!$iFileSize) {
-	header("HTTP/1.0 404 Not Found");
-	exit;
-}
 
 // List of additional locations (commonly used locations are already in download.inc.php)
 $aList = array();
diff --git a/winemono.php b/winemono.php
index 3758d0e..a6d7583 100644
--- a/winemono.php
+++ b/winemono.php
@@ -36,10 +36,6 @@ $aFileSizes = array(
 
 // Exact size of the file:
 $iFileSize = $aFileSizes[$sFileSuffix];
-if(!$iFileSize) {
-	header("HTTP/1.0 404 Not Found");
-	exit;
-}
 
 // List of additional locations (commonly used locations are already in download.inc.php)
 $aList = array();




More information about the wine-cvs mailing list