It's certain a serious bug.
I accessed memcached with ASCII-PROTOCOL initially, it's OK, but when
accessed memcached with the SAME SOCKET with BINARY-PROTOCOL following
i'm failed to get response. After hard debuging, i found it's because
memcached had ever remember the PROTOCOL-TYPE just by the initial
request, no matter the following request-protocol-type.
i modified corresponding code, just commenced two lines at
memcached.c(version: 1.4.9).now it's ok.
here is(funciont:try_read_command()):
/* We will change protocol during one long connection */
//if (c->protocol == negotiating_prot || c->transport ==
udp_transport) {
if ((unsigned char)c->rbuf[0] == (unsigned
char)PROTOCOL_BINARY_REQ) {
c->protocol = binary_prot;
} else {
c->protocol = ascii_prot;
}
if (settings.verbose > 1) {
fprintf(stderr, "%d: Client using the %s protocol\n", c-
>sfd,
prot_text(c->protocol));
}
//}
I'd like to see it to be fixed in afterwards version. thanks.