static memcached_return set_socket_options(memcached_server_st *ptr)
{
+ WATCHPOINT_ASSERT(ptr->fd != -1);
+
if (ptr->type == MEMCACHED_CONNECTION_UDP)
return MEMCACHED_SUCCESS;
+#ifndef __sun
if (ptr->root->snd_timeout)
{
int error;
&waittime, (socklen_t)sizeof(struct timeval));
WATCHPOINT_ASSERT(error == 0);
}
+#endif
{
int error;
}
}
}
+
+ WATCHPOINT_ASSERT(ptr->fd != -1);
return MEMCACHED_SUCCESS;
}
ptr->cached_errno= errno;
WATCHPOINT_ERRNO(ptr->cached_errno);
WATCHPOINT_NUMBER(ptr->root->connect_timeout);
- close(ptr->fd);
- ptr->fd= -1;
- if (ptr->address_info)
- {
- freeaddrinfo(ptr->address_info);
- ptr->address_info= NULL;
- }
+ memcached_quit_server(ptr, 1);
if (ptr->root->retry_timeout)
{
ptr->next_retry= next_time.tv_sec + ptr->root->retry_timeout;
}
ptr->server_failure_counter+= 1;
+
return MEMCACHED_ERRNO;
}