projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge up.
[awesomized/libmemcached]
/
libmemcached
/
io.cc
diff --git
a/libmemcached/io.cc
b/libmemcached/io.cc
index fbfb8555e975cb6d164b3b6ba1f5ac4cc7ca6a79..049c436dbcb7f24e12a2511c32b00e88b192bade 100644
(file)
--- a/
libmemcached/io.cc
+++ b/
libmemcached/io.cc
@@
-192,8
+192,7
@@
static memcached_return_t io_wait(memcached_server_write_instance_st ptr,
*/
if (read_or_write == MEM_WRITE)
{
*/
if (read_or_write == MEM_WRITE)
{
- memcached_return_t rc= memcached_purge(ptr);
- if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_STORED)
+ if (memcached_fatal(memcached_purge(ptr)))
{
return MEMCACHED_FAILURE;
}
{
return MEMCACHED_FAILURE;
}
@@
-278,11
+277,10
@@
static bool io_flush(memcached_server_write_instance_st ptr,
** in the purge function to avoid duplicating the logic..
*/
{
** in the purge function to avoid duplicating the logic..
*/
{
- memcached_return_t rc;
WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);
WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);
- rc= memcached_purge(ptr);
+
memcached_return_t
rc= memcached_purge(ptr);
- if (rc != MEMCACHED_SUCCESS
&&
rc != MEMCACHED_STORED)
+ if (rc != MEMCACHED_SUCCESS
and
rc != MEMCACHED_STORED)
{
return false;
}
{
return false;
}
@@
-675,9
+673,9
@@
memcached_server_write_instance_st memcached_io_get_readable_server(memcached_st
{
#define MAX_SERVERS_TO_POLL 100
struct pollfd fds[MAX_SERVERS_TO_POLL];
{
#define MAX_SERVERS_TO_POLL 100
struct pollfd fds[MAX_SERVERS_TO_POLL];
-
unsigned in
t host_index= 0;
+
nfds_
t host_index= 0;
- for (uint32_t x= 0; x < memcached_server_count(memc)
&&
host_index < MAX_SERVERS_TO_POLL; ++x)
+ for (uint32_t x= 0; x < memcached_server_count(memc)
and
host_index < MAX_SERVERS_TO_POLL; ++x)
{
memcached_server_write_instance_st instance= memcached_server_instance_fetch(memc, x);
{
memcached_server_write_instance_st instance= memcached_server_instance_fetch(memc, x);
@@
-722,17
+720,18
@@
memcached_server_write_instance_st memcached_io_get_readable_server(memcached_st
break;
default:
break;
default:
- for (
size
_t x= 0; x < host_index; ++x)
+ for (
nfds
_t x= 0; x < host_index; ++x)
{
if (fds[x].revents & POLLIN)
{
for (uint32_t y= 0; y < memcached_server_count(memc); ++y)
{
{
if (fds[x].revents & POLLIN)
{
for (uint32_t y= 0; y < memcached_server_count(memc); ++y)
{
- memcached_server_write_instance_st instance=
- memcached_server_instance_fetch(memc, y);
+ memcached_server_write_instance_st instance= memcached_server_instance_fetch(memc, y);
if (instance->fd == fds[x].fd)
if (instance->fd == fds[x].fd)
+ {
return instance;
return instance;
+ }
}
}
}
}
}
}