projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
add test for longer data, 8K
[m6w6/libmemcached]
/
lib
/
memcached_get.c
diff --git
a/lib/memcached_get.c
b/lib/memcached_get.c
index 9eb60e2668afafecc589ef800955540220c93238..560a50de07dffb36274fcaff566ecc350a6dac48 100644
(file)
--- a/
lib/memcached_get.c
+++ b/
lib/memcached_get.c
@@
-22,14
+22,24
@@
char *memcached_get(memcached_st *ptr, char *key, size_t key_length,
(int)key_length, key);
if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
(int)key_length, key);
if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
- return MEMCACHED_WRITE_FAILURE;
+ {
+ *error= MEMCACHED_WRITE_FAILURE;
+ return NULL;
+ }
- if ((sent_length = write(ptr->hosts[server_key].fd, buffer, send_length) == -1))
+ sent_length= write(ptr->hosts[server_key].fd, buffer, send_length);
+
+ if (sent_length == -1)
{
{
+ fprintf(stderr, "error %s: write: %m\n", __FUNCTION__);
*error= MEMCACHED_WRITE_FAILURE;
return NULL;
}
*error= MEMCACHED_WRITE_FAILURE;
return NULL;
}
- if (sent_length != send_length) {
+
+ if (sent_length != send_length)
+ {
+ fprintf(stderr, "error %s: short write %d %d: %m\n",
+ __FUNCTION__, sent_length, send_length);
*error= MEMCACHED_WRITE_FAILURE;
return NULL;
}
*error= MEMCACHED_WRITE_FAILURE;
return NULL;
}