����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /proc/self/root/usr/share/tests/pecl/memcached/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/share/tests/pecl/memcached/tests/stats_hang.phpt
--TEST--
Check stats does not hang on non-blocking binary protocol
--SKIPIF--
<?php include "skipif.inc";?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
$m = memc_get_instance ();

$key = MEMC_SERVER_HOST . ':' . MEMC_SERVER_PORT;

// Both options set means we have to reconnect to get stats
$m->setOption(Memcached::OPT_NO_BLOCK, true);
$m->setOption(Memcached::OPT_BINARY_PROTOCOL, true);

$stats = $m->getStats();
$conns1 = $stats[$key]['total_connections'];

$stats = $m->getStats();
$conns2 = $stats[$key]['total_connections'];

var_dump($conns1 == $conns2);
var_dump($m->getOption(Memcached::OPT_NO_BLOCK));
var_dump($m->getOption(Memcached::OPT_BINARY_PROTOCOL));
echo "OK" . PHP_EOL;

// If either or both options are false no need to reconnect
$m->setOption(Memcached::OPT_NO_BLOCK, false);
$m->setOption(Memcached::OPT_BINARY_PROTOCOL, true);

$stats = $m->getStats();
$conns1 = $stats[$key]['total_connections'];

$stats = $m->getStats();
$conns2 = $stats[$key]['total_connections'];

var_dump($conns1 == $conns2);
var_dump($m->getOption(Memcached::OPT_NO_BLOCK));
var_dump($m->getOption(Memcached::OPT_BINARY_PROTOCOL));
echo "OK" . PHP_EOL;

// If either or both options are false no need to reconnect
$m->setOption(Memcached::OPT_NO_BLOCK, true);
$m->setOption(Memcached::OPT_BINARY_PROTOCOL, false);

$stats = $m->getStats();
$conns1 = $stats[$key]['total_connections'];

$stats = $m->getStats();
$conns2 = $stats[$key]['total_connections'];

var_dump($conns1 == $conns2);
var_dump($m->getOption(Memcached::OPT_NO_BLOCK));
var_dump($m->getOption(Memcached::OPT_BINARY_PROTOCOL));
echo "OK" . PHP_EOL;

// If either or both options are false no need to reconnect
$m->setOption(Memcached::OPT_NO_BLOCK, false);
$m->setOption(Memcached::OPT_BINARY_PROTOCOL, false);

$stats = $m->getStats();
$conns1 = $stats[$key]['total_connections'];

$stats = $m->getStats();
$conns2 = $stats[$key]['total_connections'];

var_dump($conns1 == $conns2);
var_dump($m->getOption(Memcached::OPT_NO_BLOCK));
var_dump($m->getOption(Memcached::OPT_BINARY_PROTOCOL));
echo "OK" . PHP_EOL;

?>
--EXPECT--
bool(false)
int(1)
int(1)
OK
bool(true)
int(0)
int(1)
OK
bool(true)
int(1)
int(0)
OK
bool(true)
int(0)
int(0)
OK

ZeroDay Forums Mini