memcached_return_t memcached_server_error_return(memcached_server_instance_st ptr)
{
+ if (ptr == NULL)
+ {
+ return MEMCACHED_INVALID_ARGUMENTS;
+ }
+
if (ptr and ptr->error_messages)
{
return ptr->error_messages->rc;
}
- return MEMCACHED_FAILURE;
+ return MEMCACHED_SUCCESS;
}
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: