cvs: php-master-web /manage mirrors.php /scripts mirror-test

From: Date: Mon, 06 Jan 2003 13:58:45 +0000
Subject: cvs: php-master-web /manage mirrors.php /scripts mirror-test
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-14793@lists.php.net to get a copy of this message
goba Mon Jan 6 08:58:45 2003 EDT Modified files: /php-master-web/manage mirrors.php /php-master-web/scripts mirror-test Log: Adding debug information, if $test_debug is on (if included from manage/mirrors.php) Index: php-master-web/manage/mirrors.php diff -u php-master-web/manage/mirrors.php:1.31 php-master-web/manage/mirrors.php:1.32 --- php-master-web/manage/mirrors.php:1.31 Mon Jan 6 08:38:20 2003 +++ php-master-web/manage/mirrors.php Mon Jan 6 08:58:44 2003 @@ -6,7 +6,9 @@ // A mirror check is needed now, try to do it if (isset($checkmirrors)) { ignore_user_abort(TRUE); + $test_debug = TRUE; include_once "../scripts/mirror-test"; + exit; } // This page is for mirror administration Index: php-master-web/scripts/mirror-test diff -u php-master-web/scripts/mirror-test:1.22 php-master-web/scripts/mirror-test:1.23 --- php-master-web/scripts/mirror-test:1.22 Mon Jan 6 06:30:09 2003 +++ php-master-web/scripts/mirror-test Mon Jan 6 08:58:45 2003 @@ -40,7 +40,7 @@ // If we were unable to open the port, continue with the next mirror if (!$fp) { - // echo "unable to connect to $row[hostname]\n"; + if ($test_debug) { echo "unable to connect to $row[hostname]\n"; flush(); } continue; } @@ -48,7 +48,10 @@ $rc = fputs($fp, "GET /mirror-info.php HTTP/1.0\r\nHost: $row[hostname]\r\n\r\n"); // If we were unable to write to socket, skip mirror site - if ($rc === FALSE) { continue; } + if ($rc === FALSE) { + if ($test_debug) { echo "unable to send request to $row[hostname]\n"; flush(); } + continue; + } // Set timeout to 5 seconds socket_set_timeout($fp, 5, 0); @@ -61,7 +64,7 @@ // If we were unable to pass the HTTP header, skip mirror site if ($line === FALSE || $line == "") { - // echo "didn't get past headers for $row[hostname]\n"; + if ($test_debug) { echo "didn't get past headers for $row[hostname]\n"; flush(); } continue; } @@ -70,8 +73,10 @@ // If unable to read that row, skip mirror site if ($rv === FALSE) { - // echo "didn't get data for $row[hostname]\n"; + if ($test_debug) { echo "didn't get data for $row[hostname]\n"; flush(); } continue; + } else { + if ($test_debug) { echo "received data from $row[hostname]\n"; flush(); } } // Exlode information row by delimiter

« previous php.mirrors (#14793) next »