header.response.cas= memcached_ntohll(header.response.cas);
uint32_t bodylen= header.response.bodylen;
- if (header.response.status == PROTOCOL_BINARY_RESPONSE_SUCCESS ||
+ if (header.response.status == PROTOCOL_BINARY_RESPONSE_SUCCESS or
header.response.status == PROTOCOL_BINARY_RESPONSE_AUTH_CONTINUE)
{
switch (header.response.opcode)
case PROTOCOL_BINARY_CMD_APPENDQ:
case PROTOCOL_BINARY_CMD_PREPENDQ:
return binary_read_one_response(ptr, buffer, buffer_length, result);
+
default:
break;
}
}
rc= MEMCACHED_SUCCESS;
- unlikely(header.response.status != 0)
+ if (header.response.status != 0)
+ {
switch (header.response.status)
{
case PROTOCOL_BINARY_RESPONSE_KEY_ENOENT:
rc= MEMCACHED_NOTFOUND;
break;
+
case PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS:
rc= MEMCACHED_DATA_EXISTS;
break;
+
case PROTOCOL_BINARY_RESPONSE_NOT_STORED:
rc= MEMCACHED_NOTSTORED;
break;
+
case PROTOCOL_BINARY_RESPONSE_E2BIG:
rc= MEMCACHED_E2BIG;
break;
+
case PROTOCOL_BINARY_RESPONSE_ENOMEM:
rc= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
break;
+
case PROTOCOL_BINARY_RESPONSE_AUTH_CONTINUE:
rc= MEMCACHED_AUTH_CONTINUE;
break;
+
case PROTOCOL_BINARY_RESPONSE_AUTH_ERROR:
rc= MEMCACHED_AUTH_FAILURE;
break;
+
case PROTOCOL_BINARY_RESPONSE_EINVAL:
case PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND:
default:
rc= MEMCACHED_PROTOCOL_ERROR;
break;
}
+ }
return rc;
}