mirror of
https://github.com/php-win-ext/php-memcached.git
synced 2026-03-24 00:52:18 +01:00
valgrind
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user