cvs: php-master-web /scripts mirror-test
| From: | Gabor Hojtsy | Date: | Mon, 04 Aug 2003 09:49:16 +0000 |
| Subject: | cvs: php-master-web /scripts mirror-test | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-19804@lists.php.net to get a copy of this message | ||
goba Mon Aug 4 05:49:16 2003 EDT
Modified files:
/php-master-web/scripts mirror-test
Log:
Handle www.php.net specially, as it loads off the shortcut
requests to mirror sites, so we cannot get proper mirror info
if we send a request to the shortcut...
Index: php-master-web/scripts/mirror-test
diff -u php-master-web/scripts/mirror-test:1.45 php-master-web/scripts/mirror-test:1.46
--- php-master-web/scripts/mirror-test:1.45 Sat Aug 2 16:18:09 2003
+++ php-master-web/scripts/mirror-test Mon Aug 4 05:49:16 2003
@@ -44,9 +44,18 @@
$hosts[$index]['problem'] = "unable to connect";
continue;
}
+
+ // Request the exact file on www.php.net as it redirects
+ // the request to a mirror site, and we would not handle
+ // that properly...
+ if ($row['hostname'] == 'www.php.net') {
+ $filename = '/mirror-info.php';
+ } else {
+ $filename = '/mirror-info';
+ }
// GET mirror-info.php from the registered hostname
- $rc = fputs($fp, "GET /mirror-info HTTP/1.0\r\nHost: $host[hostname]\r\n\r\n");
+ $rc = fputs($fp, "GET $filename HTTP/1.0\r\nHost: $host[hostname]\r\n\r\n");
// If we were unable to write to socket, skip mirror site
if ($rc === FALSE) {