projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Update libtest/fedora/lion fixes
[awesomized/libmemcached]
/
libmemcached
/
server.cc
diff --git
a/libmemcached/server.cc
b/libmemcached/server.cc
index f5fe62e19bf3729fe867c1542c29bc286196ee45..bde53c7e4c68954f3bd6081d81a8ebdeb1ece3f9 100644
(file)
--- a/
libmemcached/server.cc
+++ b/
libmemcached/server.cc
@@
-39,7
+39,6
@@
This is a partial implementation for fetching/creating memcached_server_st objects.
*/
#include <libmemcached/common.h>
This is a partial implementation for fetching/creating memcached_server_st objects.
*/
#include <libmemcached/common.h>
-#include <cassert>
static inline void _server_init(memcached_server_st *self, memcached_st *root,
const char *hostname, in_port_t port,
static inline void _server_init(memcached_server_st *self, memcached_st *root,
const char *hostname, in_port_t port,
@@
-120,7
+119,9
@@
memcached_server_st *__server_create_with(const memcached_st *memc,
self= _server_create(self, memc);
if (not self)
self= _server_create(self, memc);
if (not self)
+ {
return NULL;
return NULL;
+ }
_server_init(self, const_cast<memcached_st *>(memc), hostname, port, weight, type);
_server_init(self, const_cast<memcached_st *>(memc), hostname, port, weight, type);
@@
-141,6
+142,7
@@
void __server_free(memcached_server_st *self)
if (self->address_info)
{
freeaddrinfo(self->address_info);
if (self->address_info)
{
freeaddrinfo(self->address_info);
+ self->address_info= NULL;
}
memcached_error_free(*self);
}
memcached_error_free(*self);
@@
-237,7
+239,9
@@
memcached_return_t memcached_server_execute(memcached_st *ptr,
unsigned int iferror= (*callback)(ptr, instance, context);
if (iferror)
unsigned int iferror= (*callback)(ptr, instance, context);
if (iferror)
+ {
continue;
continue;
+ }
}
return MEMCACHED_SUCCESS;
}
return MEMCACHED_SUCCESS;
@@
-281,7
+285,9
@@
void memcached_server_error_reset(memcached_server_st *self)
{
WATCHPOINT_ASSERT(self);
if (not self)
{
WATCHPOINT_ASSERT(self);
if (not self)
+ {
return;
return;
+ }
memcached_error_free(*self);
}
memcached_error_free(*self);
}
@@
-313,7
+319,7
@@
uint32_t memcached_server_count(const memcached_st *self)
return self->number_of_hosts;
}
return self->number_of_hosts;
}
-const char *memcached_server_name(memcached_server_instance_st self)
+const char *memcached_server_name(
const
memcached_server_instance_st self)
{
WATCHPOINT_ASSERT(self);
if (not self)
{
WATCHPOINT_ASSERT(self);
if (not self)
@@
-322,7
+328,7
@@
const char *memcached_server_name(memcached_server_instance_st self)
return self->hostname;
}
return self->hostname;
}
-in_port_t memcached_server_port(memcached_server_instance_st self)
+in_port_t memcached_server_port(
const
memcached_server_instance_st self)
{
WATCHPOINT_ASSERT(self);
if (not self)
{
WATCHPOINT_ASSERT(self);
if (not self)
@@
-331,7
+337,7
@@
in_port_t memcached_server_port(memcached_server_instance_st self)
return self->port;
}
return self->port;
}
-uint32_t memcached_server_response_count(memcached_server_instance_st self)
+uint32_t memcached_server_response_count(
const
memcached_server_instance_st self)
{
WATCHPOINT_ASSERT(self);
if (not self)
{
WATCHPOINT_ASSERT(self);
if (not self)
@@
-340,7
+346,7
@@
uint32_t memcached_server_response_count(memcached_server_instance_st self)
return self->cursor_active;
}
return self->cursor_active;
}
-const char *memcached_server_type(memcached_server_instance_st ptr)
+const char *memcached_server_type(
const
memcached_server_instance_st ptr)
{
if (ptr)
{
{
if (ptr)
{