}
#ifdef HAVE_SNDTIMEO
- if (server->root->snd_timeout)
+ if (server->root->snd_timeout > 0)
{
struct timeval waittime;
- waittime.tv_sec= 0;
- waittime.tv_usec= server->root->snd_timeout;
+ waittime.tv_sec= server->root->snd_timeout / 1000000;
+ waittime.tv_usec= server->root->snd_timeout % 1000000;
int error= setsockopt(server->fd, SOL_SOCKET, SO_SNDTIMEO,
- &waittime, (socklen_t)sizeof(struct timeval));
- (void)(error);
+ &waittime, (socklen_t)sizeof(struct timeval));
assert(error == 0);
}
#endif
#ifdef HAVE_RCVTIMEO
- if (server->root->rcv_timeout)
+ if (server->root->rcv_timeout > 0)
{
struct timeval waittime;
- waittime.tv_sec= 0;
- waittime.tv_usec= server->root->rcv_timeout;
+ waittime.tv_sec= server->root->rcv_timeout / 1000000;
+ waittime.tv_usec= server->root->rcv_timeout % 1000000;
int error= setsockopt(server->fd, SOL_SOCKET, SO_RCVTIMEO,
&waittime, (socklen_t)sizeof(struct timeval));
memcached_return_t memcached_connect_try(org::libmemcached::Instance* server)
{
+ if (server and server->root and server->root->state.is_parsing)
+ {
+ return MEMCACHED_SUCCESS;
+ }
+
return _memcached_connect(server, false);
}
test_true(memc);
test_compare(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SND_TIMEOUT, 2000000), MEMCACHED_SUCCESS);
+ test_compare(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_RCV_TIMEOUT, 3000000), MEMCACHED_SUCCESS);
memcached_return_t rc;