Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ext/curl/tests/curl_setopt_ssl.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ if ($process === false) {
}
try {
// Give the server time to start
sleep(1);
for ($i = 0; $i < 100; $i++) {
Comment thread
Sjord marked this conversation as resolved.
if (@fsockopen('127.0.0.1', $port)) break;
usleep(20000);
}

echo "case 1: client cert and key from string\n";
$ch = curl_init("https://127.0.0.1:$port/");
Expand Down
12 changes: 6 additions & 6 deletions ext/curl/tests/server.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function curl_cli_server_start() {
// First, wait for the dev server to declare itself ready.
$bound = null;
stream_set_blocking($pipes[2], false);
for ($i = 0; $i < 60; $i++) {
usleep(50000); // 50ms per try
Comment thread
devnexen marked this conversation as resolved.
for ($i = 0; $i < 150; $i++) {
usleep(20000); // 20ms per try
$status = proc_get_status($handle);
if (empty($status['running'])) {
echo "Server is not running\n";
Expand Down Expand Up @@ -44,8 +44,7 @@ function curl_cli_server_start() {
// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
// it might not be listening yet...need to wait until fsockopen() call returns
$error = "Unable to connect to server\n";
for ($i=0; $i < 60; $i++) {
usleep(50000); // 50ms per try
for ($i=0; $i < 150; $i++) {
$status = proc_get_status($handle);
$fp = @fsockopen("tcp://$bound");
// Failure, the server is no longer running
Expand All @@ -58,6 +57,7 @@ function curl_cli_server_start() {
$error = '';
break;
}
usleep(20000); // 20ms per try
}

if ($fp) {
Expand All @@ -74,12 +74,12 @@ function curl_cli_server_start() {
function($handle) {
proc_terminate($handle);
/* Wait for server to shutdown */
for ($i = 0; $i < 60; $i++) {
for ($i = 0; $i < 150; $i++) {
$status = proc_get_status($handle);
if (!($status && $status['running'])) {
break;
}
usleep(50000);
usleep(20000);
}
},
$handle
Expand Down
Loading