projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Turns out the protocol docs were in error, and that the size for 1.2 was a
[awesomized/libmemcached]
/
lib
/
memcached_fetch.c
diff --git
a/lib/memcached_fetch.c
b/lib/memcached_fetch.c
index d96d33fb2e92329fbf44fbab07f8a9b836b6bfa9..4f6a575cb03732152427fe34f0bf72acfb54a9d5 100644
(file)
--- a/
lib/memcached_fetch.c
+++ b/
lib/memcached_fetch.c
@@
-3,7
+3,7
@@
static memcached_return memcached_value_fetch(memcached_st *ptr, char *key, size_t *key_length,
memcached_string_st *value,
static memcached_return memcached_value_fetch(memcached_st *ptr, char *key, size_t *key_length,
memcached_string_st *value,
- uint
16
_t *flags,
+ uint
32
_t *flags,
uint64_t *cas,
unsigned int server_key)
{
uint64_t *cas,
unsigned int server_key)
{
@@
-35,7
+35,7
@@
static memcached_return memcached_value_fetch(memcached_st *ptr, char *key, size
{
*key_length= 0;
{
*key_length= 0;
- for (; is
alnum
(*string_ptr); string_ptr++)
+ for (; is
graph
(*string_ptr); string_ptr++)
{
*key= *string_ptr;
key++;
{
*key= *string_ptr;
key++;
@@
-43,7
+43,7
@@
static memcached_return memcached_value_fetch(memcached_st *ptr, char *key, size
}
}
else /* Skip characters */
}
}
else /* Skip characters */
- for (; is
alnum
(*string_ptr); string_ptr++);
+ for (; is
graph
(*string_ptr); string_ptr++);
if (end_ptr == string_ptr)
goto read_error;
if (end_ptr == string_ptr)
goto read_error;
@@
-54,7
+54,7
@@
static memcached_return memcached_value_fetch(memcached_st *ptr, char *key, size
goto read_error;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
if (flags)
goto read_error;
for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++);
if (flags)
- *flags= (uint
16
_t)strtol(next_ptr, &string_ptr, 10);
+ *flags= (uint
32
_t)strtol(next_ptr, &string_ptr, 10);
if (end_ptr == string_ptr)
goto read_error;
if (end_ptr == string_ptr)
goto read_error;
@@
-141,12
+141,15
@@
read_error:
char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
size_t *value_length,
char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
size_t *value_length,
- uint
16
_t *flags,
+ uint
32
_t *flags,
memcached_return *error)
{
memcached_string_st *result_buffer;
result_buffer= &ptr->result_buffer;
memcached_return *error)
{
memcached_string_st *result_buffer;
result_buffer= &ptr->result_buffer;
+ if (ptr->flags & MEM_NO_BLOCK)
+ memcached_io_preread(ptr);
+
while (ptr->cursor_server < ptr->number_of_hosts)
{
if (!ptr->hosts[ptr->cursor_server].cursor_active)
while (ptr->cursor_server < ptr->number_of_hosts)
{
if (!ptr->hosts[ptr->cursor_server].cursor_active)
@@
-185,6
+188,9
@@
memcached_result_st *memcached_fetch_result(memcached_st *ptr,
WATCHPOINT_ASSERT(result->value.is_allocated != MEMCACHED_USED);
WATCHPOINT_ASSERT(result->value.is_allocated != MEMCACHED_USED);
+ if (ptr->flags & MEM_NO_BLOCK)
+ memcached_io_preread(ptr);
+
while (ptr->cursor_server < ptr->number_of_hosts)
{
if (!ptr->hosts[ptr->cursor_server].cursor_active)
while (ptr->cursor_server < ptr->number_of_hosts)
{
if (!ptr->hosts[ptr->cursor_server].cursor_active)
@@
-212,7
+218,7
@@
memcached_result_st *memcached_fetch_result(memcached_st *ptr,
return NULL;
}
return NULL;
}
- /*
An error has occurred
*/
+ /*
We have completed reading data
*/
if (result->is_allocated == MEMCACHED_ALLOCATED)
memcached_result_free(result);
else
if (result->is_allocated == MEMCACHED_ALLOCATED)
memcached_result_free(result);
else