This commit is contained in:
Michael Wallner
2021-01-20 18:00:52 +01:00
parent bee6b53d57
commit 9840866332
2 changed files with 12 additions and 4 deletions

View File

@@ -3925,7 +3925,6 @@ static
PHP_GINIT_FUNCTION(php_memcached)
{
#ifdef HAVE_MEMCACHED_SESSION
php_memcached_globals->session.lock_enabled = 0;
php_memcached_globals->session.lock_wait_max = 150;
php_memcached_globals->session.lock_wait_min = 150;
@@ -3944,8 +3943,12 @@ PHP_GINIT_FUNCTION(php_memcached)
php_memcached_globals->session.persistent_enabled = 0;
php_memcached_globals->session.sasl_username = NULL;
php_memcached_globals->session.sasl_password = NULL;
#endif
#ifdef HAVE_MEMCACHED_PROTOCOL
memset(&php_memcached_globals->server, 0, sizeof(php_memcached_globals->server));
#endif
php_memcached_globals->memc.serializer_name = NULL;
php_memcached_globals->memc.serializer_type = SERIALIZER_DEFAULT;
php_memcached_globals->memc.compression_name = NULL;

View File

@@ -23,7 +23,7 @@ function memcached_server_start($code = 'server.php', $host = "127.0.0.1", $port
// 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++) {
for ($i=0; $i < getenv("VALGRIND") ? 1000 : 60; $i++) {
usleep(50000); // 50ms per try
$status = proc_get_status($handle);
$fp = @fsockopen($host, $port);
@@ -46,12 +46,16 @@ function memcached_server_start($code = 'server.php', $host = "127.0.0.1", $port
if ($error) {
echo $error;
proc_terminate($handle);
proc_close($handle);
exit(1);
}
register_shutdown_function(
function($handle) {
proc_terminate($handle);
if (is_resource($handle)) {
proc_terminate($handle);
proc_close($handle);
}
},
$handle
);
@@ -72,6 +76,7 @@ function memcached_server_stop($handle) {
}
usleep(50000);
}
proc_close($handle);
}
return $success;
}