projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (from parent 1:
6f42f1c
)
Do not try to run the binary protocol testsuite for pre-1.3 servers
author
Trond Norbye
<trond.norbye@sun.com>
Sun, 3 Aug 2008 12:57:01 +0000
(14:57 +0200)
committer
Trond Norbye
<trond.norbye@sun.com>
Sun, 3 Aug 2008 12:57:01 +0000
(14:57 +0200)
tests/function.c
patch
|
blob
|
history
diff --git
a/tests/function.c
b/tests/function.c
index 1cfd96a4f32660e8d4e3e4f18ffe4380881162f4..fb7abd6fb96ea594e1381c4b8cc80be6c755d22e 100644
(file)
--- a/
tests/function.c
+++ b/
tests/function.c
@@
-2597,16
+2597,26
@@
memcached_return pre_behavior_ketama_weighted(memcached_st *memc)
memcached_return pre_binary(memcached_st *memc)
{
memcached_return pre_binary(memcached_st *memc)
{
- memcached_return rc;
-
- rc = memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1);
- assert(rc == MEMCACHED_SUCCESS);
+ memcached_return rc= MEMCACHED_FAILURE;
+ memcached_st *clone;
- assert(memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) == 1);
+ clone= memcached_clone(NULL, memc);
+ assert(clone);
+ // The memcached_version needs to be done on a clone, because the server
+ // will not toggle protocol on an connection.
+ memcached_version(clone);
- return MEMCACHED_SUCCESS;
+ if (clone->hosts[0].major_version >= 1 && clone->hosts[0].minor_version > 2)
+ {
+ rc = memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1);
+ assert(rc == MEMCACHED_SUCCESS);
+ assert(memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) == 1);
+ }
+ memcached_free(clone);
+ return rc;
}
}
+
void my_free(memcached_st *ptr, void *mem)
{
free(mem);
void my_free(memcached_st *ptr, void *mem)
{
free(mem);
@@
-2967,7
+2977,7
@@
test_st consistent_weighted_tests[] ={
collection_st collection[] ={
{"block", 0, 0, tests},
collection_st collection[] ={
{"block", 0, 0, tests},
-
//
{"binary", pre_binary, 0, tests},
+ {"binary", pre_binary, 0, tests},
{"nonblock", pre_nonblock, 0, tests},
{"nodelay", pre_nodelay, 0, tests},
{"settimer", pre_settimer, 0, tests},
{"nonblock", pre_nonblock, 0, tests},
{"nodelay", pre_nodelay, 0, tests},
{"settimer", pre_settimer, 0, tests},