projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Deprecate MEMCACHED_NO_KEY_PROVIDED, and fixed key validation tests for the binary...
[awesomized/libmemcached]
/
libmemcached
/
memcached_get.c
diff --git
a/libmemcached/memcached_get.c
b/libmemcached/memcached_get.c
index dd02cf29c7151362fd87f3ea47a40fd3d7b11b2f..a7bf3a963b8f4b422f38595176321a85bf8bab58 100644
(file)
--- a/
libmemcached/memcached_get.c
+++ b/
libmemcached/memcached_get.c
@@
-281,6
+281,15
@@
static memcached_return binary_mget_by_key(memcached_st *ptr,
else
request.message.header.request.opcode= PROTOCOL_BINARY_CMD_GETKQ;
else
request.message.header.request.opcode= PROTOCOL_BINARY_CMD_GETKQ;
+ memcached_return vk;
+ vk= memcached_validate_key_length(key_length[x],
+ ptr->flags & MEM_BINARY_PROTOCOL);
+ unlikely (vk != MEMCACHED_SUCCESS) {
+ if (x > 0)
+ memcached_io_reset(ptr);
+ return vk;
+ }
+
request.message.header.request.keylen= htons((uint16_t)key_length[x]);
request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES;
request.message.header.request.bodylen= htonl(key_length[x]);
request.message.header.request.keylen= htons((uint16_t)key_length[x]);
request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES;
request.message.header.request.bodylen= htonl(key_length[x]);