libmemcached binary Touch breaks next command
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmemcached |
Fix Released
|
Medium
|
Brian Aker |
Bug Description
The binary mode Touch command is broken in libmemcached 1.0.15 and earlier with at least some versions of memcached. Any commands issued after the Touch fail with a bad magic number error.
The problem is that with (at least) memcached version 1.4.15 the response from the touch command returns 4 bytes of body data. The libmemcached response processor assumes that Touch does not return any data so the extra 4 bytes are read as the response to the next command. The library will ASSERT if they are enabled but at least my build has ASSERTs turned off.
Patch:
*** response.cc 2012-11-11 22:27:27.000000000 -0800
--- response-new.cc 2013-01-24 17:43:41.080530500 -0800
***************
*** 659,664 ****
--- 659,668 ----
case PROTOCOL_
{
+ if (bodylen != 0)
+ {
+ rc= memcached_
+ }
return MEMCACHED_SUCCESS;
}
Changed in libmemcached: | |
status: | In Progress → Fix Committed |
milestone: | none → 1.0.16 |
Changed in libmemcached: | |
status: | Fix Committed → Fix Released |
Any idea on what those four bytes are?