Deprecate MEMCACHED_NO_KEY_PROVIDED, and fixed key validation tests for the binary...
[awesomized/libmemcached] / libmemcached / memcached_storage.c
index 770b27d4006a2a46137f89501b642750bce4643e..1ac70d146c9971c839fa6e0a59694dee81937686 100644 (file)
@@ -70,9 +70,10 @@ static inline memcached_return memcached_send(memcached_st *ptr,
 
   WATCHPOINT_ASSERT(!(value == NULL && value_length > 0));
 
-  unlikely (key_length == 0)
-    return MEMCACHED_NO_KEY_PROVIDED;
-
+  rc= memcached_validate_key_length(key_length, ptr->flags & MEM_BINARY_PROTOCOL);
+  unlikely (rc != MEMCACHED_SUCCESS)
+    return rc;
+  
   unlikely (ptr->number_of_hosts == 0)
     return MEMCACHED_NO_SERVERS;