projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Cleanup warnings/found issue in store by key functions.
[m6w6/libmemcached]
/
libmemcached
/
memcached_fetch.c
diff --git
a/libmemcached/memcached_fetch.c
b/libmemcached/memcached_fetch.c
index 303e8cc3ae4d68a7f5c4f31f1ad39099454e5fc3..4cd3e6a584b9a45280076d571aebb6b3d6d348d3 100644
(file)
--- a/
libmemcached/memcached_fetch.c
+++ b/
libmemcached/memcached_fetch.c
@@
-14,6
+14,7
@@
memcached_return value_fetch(memcached_server_st *ptr,
size_t to_read;
char *value_ptr;
size_t to_read;
char *value_ptr;
+ WATCHPOINT_ASSERT(ptr->root);
end_ptr= buffer + MEMCACHED_DEFAULT_COMMAND_SIZE;
memcached_result_reset(result);
end_ptr= buffer + MEMCACHED_DEFAULT_COMMAND_SIZE;
memcached_result_reset(result);
@@
-25,15
+26,21
@@
memcached_return value_fetch(memcached_server_st *ptr,
/* We load the key */
{
char *key;
/* We load the key */
{
char *key;
+ size_t prefix_length;
key= result->key;
result->key_length= 0;
key= result->key;
result->key_length= 0;
- for (
; isgraph(*string_ptr)
; string_ptr++)
+ for (
prefix_length= ptr->root->prefix_key_length; !(iscntrl(*string_ptr) || isspace(*string_ptr))
; string_ptr++)
{
{
- *key= *string_ptr;
- key++;
- result->key_length++;
+ if (prefix_length == 0)
+ {
+ *key= *string_ptr;
+ key++;
+ result->key_length++;
+ }
+ else
+ prefix_length--;
}
result->key[result->key_length]= 0;
}
}
result->key[result->key_length]= 0;
}
@@
-46,7
+53,7
@@
memcached_return value_fetch(memcached_server_st *ptr,
if (end_ptr == string_ptr)
goto read_error;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
if (end_ptr == string_ptr)
goto read_error;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
- result->flags=
(uint32_t)strto
l(next_ptr, &string_ptr, 10);
+ result->flags=
strtou
l(next_ptr, &string_ptr, 10);
if (end_ptr == string_ptr)
goto read_error;
if (end_ptr == string_ptr)
goto read_error;
@@
-57,7
+64,7
@@
memcached_return value_fetch(memcached_server_st *ptr,
goto read_error;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
goto read_error;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
- value_length= (size_t)strtoll(next_ptr, &string_ptr, 10);
+ value_length= (size_t)strto
u
ll(next_ptr, &string_ptr, 10);
if (end_ptr == string_ptr)
goto read_error;
if (end_ptr == string_ptr)
goto read_error;
@@
-72,7
+79,7
@@
memcached_return value_fetch(memcached_server_st *ptr,
{
string_ptr++;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
{
string_ptr++;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
- result->cas=
(size_t)strto
ll(next_ptr, &string_ptr, 10);
+ result->cas=
strtou
ll(next_ptr, &string_ptr, 10);
}
if (end_ptr < string_ptr)
}
if (end_ptr < string_ptr)
@@
-120,9
+127,9
@@
read_error:
}
char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
}
char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
- size_t *value_length,
- uint32_t *flags,
- memcached_return *error)
+
size_t *value_length,
+
uint32_t *flags,
+
memcached_return *error)
{
memcached_result_st *result_buffer= &ptr->result;
{
memcached_result_st *result_buffer= &ptr->result;