projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
libmemcached-1.0: fix #57 (cinttypes/inttypes.h)
[m6w6/libmemcached]
/
libmemcached
/
flush_buffers.cc
diff --git
a/libmemcached/flush_buffers.cc
b/libmemcached/flush_buffers.cc
index af6942b4a79c6e9b9f1b2fee6658835186303c80..24f7c0df69ae348afae8aad95cb2ad8638347555 100644
(file)
--- a/
libmemcached/flush_buffers.cc
+++ b/
libmemcached/flush_buffers.cc
@@
-37,29
+37,35
@@
#include <libmemcached/common.h>
#include <libmemcached/common.h>
-memcached_return_t memcached_flush_buffers(memcached_st *
memc
)
+memcached_return_t memcached_flush_buffers(memcached_st *
shell
)
{
{
- memcached_return_t ret= MEMCACHED_SUCCESS;
-
- for (uint32_t x= 0; x < memcached_server_count(memc); ++x)
+ Memcached* memc= memcached2Memcached(shell);
+ if (memc)
{
{
-
org::libmemcached::Instance* instance= memcached_instance_fetch(memc, x)
;
+
memcached_return_t ret= MEMCACHED_SUCCESS
;
- if (instance->write_buffer_offset != 0)
+ for (uint32_t x= 0; x < memcached_server_count(memc); ++x)
{
{
- if (instance->fd == INVALID_SOCKET and
- (ret= memcached_connect(instance)) != MEMCACHED_SUCCESS)
- {
- WATCHPOINT_ERROR(ret);
- return ret;
- }
+ memcached_instance_st* instance= memcached_instance_fetch(memc, x);
- if (
memcached_io_write(instance) == false)
+ if (
instance->write_buffer_offset != 0)
{
{
- ret= MEMCACHED_SOME_ERRORS;
+ if (instance->fd == INVALID_SOCKET and
+ (ret= memcached_connect(instance)) != MEMCACHED_SUCCESS)
+ {
+ WATCHPOINT_ERROR(ret);
+ return ret;
+ }
+
+ if (memcached_io_write(instance) == false)
+ {
+ ret= MEMCACHED_SOME_ERRORS;
+ }
}
}
}
}
+
+ return ret;
}
}
- return
ret
;
+ return
MEMCACHED_INVALID_ARGUMENTS
;
}
}