com php-src: Fix FTP tests for Travis CI.: ext/ftp/tests/server.inc
| From: | Joe Watkins | Date: | Mon, 09 Jan 2017 00:36:39 +0000 |
| Subject: | com php-src: Fix FTP tests for Travis CI.: ext/ftp/tests/server.inc | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96634@lists.php.net to get a copy of this message | ||
Commit: 47007455dc777aee13c5de9c6751c85c957a5172
Author: Mitch Hagstrand <mhagstrand@gmail.com> Sun, 8 Jan 2017 13:25:46 -0800
Committer: Joe Watkins <krakjoe@php.net> Mon, 9 Jan 2017 00:36:39 +0000
Parents: 5b5483dc8e03dfe017868fd398cdd358e7fb1f65
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=47007455dc777aee13c5de9c6751c85c957a5172
Log:
Fix FTP tests for Travis CI.
This suppresses the errors from stream_socket_server() until
server.inc will not make anymore attempts.
Changed paths:
M ext/ftp/tests/server.inc
Diff:
diff --git a/ext/ftp/tests/server.inc b/ext/ftp/tests/server.inc
index 1a04cd1..ffef025 100644
--- a/ext/ftp/tests/server.inc
+++ b/ext/ftp/tests/server.inc
@@ -7,7 +7,7 @@ $context = stream_context_create(array('ssl' =>
array('local_cert' => dirname(__
for ($i=0; $i<10 && !$socket; ++$i) {
$port = rand(50000, 65535);
- $socket = stream_socket_server("tcp://127.0..0.1:$port", $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
+ @$socket = stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
}
//set anther random port that is not the same as $port
do{
@@ -15,6 +15,7 @@ do{
}while($pasv_port == $port);
if (!$socket) {
+ echo "$errstr ($errno)\n";
die("could not start/bind the ftp server\n");
}