Deprecate MEMCACHED_NO_KEY_PROVIDED, and fixed key validation tests for the binary...
[awesomized/libmemcached] / libmemcached / memcached_delete.c
index c1c1267c9b8653ca0eae7700b529a416e320ac7e..84b6160c2fe00a4058aed9013df56fc981d2f741 100644 (file)
@@ -26,8 +26,10 @@ memcached_return memcached_delete_by_key(memcached_st *ptr,
 
   LIBMEMCACHED_MEMCACHED_DELETE_START();
 
-  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->hosts == NULL || ptr->number_of_hosts == 0)
     return MEMCACHED_NO_SERVERS;