projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Update for next release.
[m6w6/libmemcached]
/
libmemcached
/
fetch.cc
diff --git
a/libmemcached/fetch.cc
b/libmemcached/fetch.cc
index 7ef608ddda231c9e9613b62187629aa4f6a4c949..2b5b800693c495245a3265ff49acdf65e81c344c 100644
(file)
--- a/
libmemcached/fetch.cc
+++ b/
libmemcached/fetch.cc
@@
-44,23
+44,32
@@
char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
{
memcached_result_st *result_buffer= &ptr->result;
memcached_return_t unused;
{
memcached_result_st *result_buffer= &ptr->result;
memcached_return_t unused;
- if (not error)
+ if (error == NULL)
+ {
error= &unused;
error= &unused;
+ }
-
- unlikely (ptr->flags.use_udp)
+ if (memcached_is_udp(ptr))
{
if (value_length)
{
if (value_length)
+ {
*value_length= 0;
*value_length= 0;
+ }
if (key_length)
if (key_length)
+ {
*key_length= 0;
*key_length= 0;
+ }
if (flags)
if (flags)
+ {
*flags= 0;
*flags= 0;
+ }
if (key)
if (key)
+ {
*key= 0;
*key= 0;
+ }
*error= MEMCACHED_NOT_SUPPORTED;
return NULL;
*error= MEMCACHED_NOT_SUPPORTED;
return NULL;
@@
-71,22
+80,32
@@
char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
{
WATCHPOINT_ASSERT(result_buffer == NULL);
if (value_length)
{
WATCHPOINT_ASSERT(result_buffer == NULL);
if (value_length)
+ {
*value_length= 0;
*value_length= 0;
+ }
if (key_length)
if (key_length)
+ {
*key_length= 0;
*key_length= 0;
+ }
if (flags)
if (flags)
+ {
*flags= 0;
*flags= 0;
+ }
if (key)
if (key)
+ {
*key= 0;
*key= 0;
+ }
return NULL;
}
if (value_length)
return NULL;
}
if (value_length)
+ {
*value_length= memcached_string_length(&result_buffer->value);
*value_length= memcached_string_length(&result_buffer->value);
+ }
if (key)
{
if (key)
{
@@
-94,26
+113,39
@@
char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
{
*error= MEMCACHED_KEY_TOO_BIG;
if (value_length)
{
*error= MEMCACHED_KEY_TOO_BIG;
if (value_length)
+ {
*value_length= 0;
*value_length= 0;
+ }
- if (key_length)
- *key_length= 0;
+ if (key_length)
+ {
+ *key_length= 0;
+ }
- if (flags)
- *flags= 0;
+ if (flags)
+ {
+ *flags= 0;
+ }
- if (key)
- *key= 0;
+ if (key)
+ {
+ *key= 0;
+ }
return NULL;
}
return NULL;
}
+
strncpy(key, result_buffer->item_key, result_buffer->key_length); // For the binary protocol we will cut off the key :(
if (key_length)
strncpy(key, result_buffer->item_key, result_buffer->key_length); // For the binary protocol we will cut off the key :(
if (key_length)
+ {
*key_length= result_buffer->key_length;
*key_length= result_buffer->key_length;
+ }
}
if (flags)
}
if (flags)
+ {
*flags= result_buffer->item_flags;
*flags= result_buffer->item_flags;
+ }
return memcached_string_take_value(&result_buffer->value);
}
return memcached_string_take_value(&result_buffer->value);
}
@@
-132,13
+164,13
@@
memcached_result_st *memcached_fetch_result(memcached_st *ptr,
return NULL;
}
return NULL;
}
- if (
ptr->flags.use_udp
)
+ if (
memcached_is_udp(ptr)
)
{
*error= MEMCACHED_NOT_SUPPORTED;
return NULL;
}
{
*error= MEMCACHED_NOT_SUPPORTED;
return NULL;
}
- if (
not result
)
+ if (
result == NULL
)
{
// If we have already initialized (ie it is in use) our internal, we
// create one.
{
// If we have already initialized (ie it is in use) our internal, we
// create one.
@@
-163,7
+195,11
@@
memcached_result_st *memcached_fetch_result(memcached_st *ptr,
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
*error= memcached_response(server, buffer, sizeof(buffer), result);
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
*error= memcached_response(server, buffer, sizeof(buffer), result);
- if (*error == MEMCACHED_SUCCESS)
+ if (*error == MEMCACHED_IN_PROGRESS)
+ {
+ continue;
+ }
+ else if (*error == MEMCACHED_SUCCESS)
{
result->count++;
return result;
{
result->count++;
return result;