Skip to content

Commit 94f6444

Browse files
committed
Merge pull request php-memcached-dev#130 from poison/feature-servertimeoutlimit
Added the OPT_SERVER_TIMEOUT_LIMIT behaviour.
2 parents 68e764d + 77a8089 commit 94f6444

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

memcached-api.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class Memcached {
6565

6666
const OPT_SERVER_FAILURE_LIMIT;
6767

68+
const OPT_SERVER_TIMEOUT_LIMIT;
69+
6870
const OPT_CACHE_LOOKUPS;
6971

7072
const OPT_AUTO_EJECT_HOSTS;

php_libmemcached_compat.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ memcached_st *php_memc_create_str (const char *str, size_t str_len);
4646
# define HAVE_LIBMEMCACHED_MEMCACHED 1
4747
#endif
4848

49+
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000018
50+
# define HAVE_MEMCACHED_BEHAVIOR_SERVER_TIMEOUT_LIMIT 1
51+
#endif
4952

5053
#ifdef HAVE_MEMCACHED_INSTANCE_ST
5154
typedef const memcached_instance_st * php_memcached_instance_st;

php_memcached.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4348,6 +4348,9 @@ static void php_memc_register_constants(INIT_FUNC_ARGS)
43484348
#ifdef HAVE_MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
43494349
REGISTER_MEMC_CLASS_CONST_LONG(OPT_REMOVE_FAILED_SERVERS, MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS);
43504350
#endif
4351+
#ifdef HAVE_MEMCACHED_BEHAVIOR_SERVER_TIMEOUT_LIMIT
4352+
REGISTER_MEMC_CLASS_CONST_LONG(OPT_SERVER_TIMEOUT_LIMIT, MEMCACHED_BEHAVIOR_SERVER_TIMEOUT_LIMIT);
4353+
#endif
43514354

43524355
/*
43534356
* libmemcached result codes

0 commit comments

Comments
 (0)