}
#endif
+
+#if defined(__MACH__) && defined(__APPLE__) || defined(__FreeBSD__)
+ {
+ int set = 1;
+ int error= setsockopt(ptr->fd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int));
+
+ // This is not considered a fatal error
+ if (error == -1)
+ {
+ WATCHPOINT_ERRNO(errno);
+ perror("setsockopt(SO_NOSIGPIPE)");
+ }
+ }
+#endif
+
if (ptr->root->flags.no_block)
{
int error;
}
WATCHPOINT_ASSERT(ptr->fd != -1);
+
return MEMCACHED_SUCCESS;
}
fds[0].events = POLLOUT;
int timeout= ptr->root->connect_timeout;
- if (ptr->root->flags.no_block == false)
+ if (ptr->root->flags.no_block == true)
timeout= -1;
size_t loop_max= 5;
loop_max= 1;
break;
case 0:
+ if (loop_max==1)
+ return MEMCACHED_TIMEOUT;
continue;
// A real error occurred and we need to completely bail
default:
}
#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
- if (ptr->fd != -1 && ptr->root->sasl.callbacks != NULL)
+ if (ptr->fd != -1 && ptr->root->sasl && ptr->root->sasl->callbacks)
{
memcached_return rc= memcached_sasl_authenticate_connection(ptr);
if (rc != MEMCACHED_SUCCESS)