projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Fixed test case output
[m6w6/libmemcached]
/
lib
/
memcached_get.c
diff --git
a/lib/memcached_get.c
b/lib/memcached_get.c
index 4d2b10d2edad397ae2efd18bba7a25d1a81b9bed..201cfcdf82d62b9661f838fa7e2fba70e9422573 100644
(file)
--- a/
lib/memcached_get.c
+++ b/
lib/memcached_get.c
@@
-34,10
+34,13
@@
static char *memcached_value_fetch(memcached_st *ptr, char *key, size_t *key_len
if (load_key)
{
memset(key, 0, MEMCACHED_MAX_KEY);
if (load_key)
{
memset(key, 0, MEMCACHED_MAX_KEY);
+ *key_length= 0;
+
for (; end_ptr == string_ptr || *string_ptr != ' '; string_ptr++)
{
*key= *string_ptr;
key++;
for (; end_ptr == string_ptr || *string_ptr != ' '; string_ptr++)
{
*key= *string_ptr;
key++;
+ (*key_length)++;
}
}
else /* Skip characters */
}
}
else /* Skip characters */
@@
-137,7
+140,8
@@
char *memcached_get(memcached_st *ptr, char *key, size_t key_length,
send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, "get %.*s\r\n",
(int)key_length, key);
send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, "get %.*s\r\n",
(int)key_length, key);
- if ((send(ptr->hosts[server_key].fd, buffer, send_length, 0) == -1))
+
+ if ((memcached_io_write(ptr, server_key, buffer, send_length, 1)) == -1)
{
*error= MEMCACHED_WRITE_FAILURE;
goto error;
{
*error= MEMCACHED_WRITE_FAILURE;
goto error;
@@
-239,8
+243,8
@@
memcached_return memcached_mget(memcached_st *ptr,
memcached_string_st *string= cursor_key_exec[x];
memcached_string_append(ptr, string, "\r\n", 2);
memcached_string_st *string= cursor_key_exec[x];
memcached_string_append(ptr, string, "\r\n", 2);
- if ((
send(ptr->hosts[x].fd
, string->string,
-
memcached_string_length(ptr, string), 0) == -1)
)
+ if ((
memcached_io_write(ptr, x
, string->string,
+
memcached_string_length(ptr, string), 1)) == -1
)
{
memcached_quit(ptr);
rc= MEMCACHED_SOME_ERRORS;
{
memcached_quit(ptr);
rc= MEMCACHED_SOME_ERRORS;