Skip to content

Commit 4700745

Browse files
mhagstrandkrakjoe
authored andcommitted
Fix FTP tests for Travis CI.
This suppresses the errors from stream_socket_server() until server.inc will not make anymore attempts.
1 parent 5b5483d commit 4700745

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/ftp/tests/server.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ $context = stream_context_create(array('ssl' => array('local_cert' => dirname(__
77
for ($i=0; $i<10 && !$socket; ++$i) {
88
$port = rand(50000, 65535);
99

10-
$socket = stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
10+
@$socket = stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
1111
}
1212
//set anther random port that is not the same as $port
1313
do{
1414
$pasv_port = rand(50000, 65535);
1515
}while($pasv_port == $port);
1616

1717
if (!$socket) {
18+
echo "$errstr ($errno)\n";
1819
die("could not start/bind the ftp server\n");
1920
}
2021

0 commit comments

Comments
 (0)