{
if (not self)
{
- self= (memcached_server_st *)libmemcached_malloc(memc, sizeof(memcached_server_st));
+ self= libmemcached_xmalloc(memc, struct memcached_server_st);
if (not self)
{
_server_init(self, const_cast<memcached_st *>(memc), hostname, port, weight, type);
- if (type == MEMCACHED_CONNECTION_UDP)
+ if (memc and memcached_is_udp(memc))
{
self->write_buffer_offset= UDP_DATAGRAM_HEADER_LENGTH;
memcached_io_init_udp_header(self, 0);
}
+ if (memc)
+ {
+ set_hostinfo(self);
+ }
+
return self;
}
hostname,
source->port, source->weight,
source->type);
- if (destination)
- {
- if (source->error_messages)
- {
- destination->error_messages= memcached_error_copy(*source);
- }
- }
-
return destination;
}