problem with the way the config_string is parsed by memcached()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmemcached |
Fix Released
|
Medium
|
Brian Aker |
Bug Description
Symptoms:
I was trying to use UDP to communicate with the server and provided the following config_string.
const char *udpConfigString = "--SERVER=
The subsequent calls to memcached() and memcached_set() seem to succeed but server logs show that the opcode is garbage.
Analysis:
I looked through the code and it seems like the socket connection is setup as soon as the yacc parser reads --SERVER. Instead the entire config string should be parsed before the socket connection is established.
/* Line 1806 of yacc.c */
#line 230 "libmemcached/
{
if (memcached_
{
char buffer[1024];
}
}
break;
Here the call to memcached_
Workaround:
In the config string specify --USE-UDP before --SERVER
const char *udpConfigString = "--VERIFY-KEY --SUPPORT-CAS --USE-UDP --SERVER=
Changed in libmemcached: | |
status: | New → Confirmed |
milestone: | none → 1.0.11 |
Changed in libmemcached: | |
status: | Confirmed → Fix Committed |
importance: | Undecided → Medium |
assignee: | nobody → Brian Aker (brianaker) |
Changed in libmemcached: | |
status: | Fix Committed → Fix Released |
You are right. The behavior was changed a while ago to speed up connections,... side effect is that UDP will not be set quite correctly.
This is fixable by delaying the connection until after parsing like you suggest.