if (ptr->hosts[server_key].fd == -1)
{
+ /* Old connection junk still is in the structure */
+ assert(ptr->hosts[server_key].stack_responses == 0);
+
if ((h= gethostbyname(ptr->hosts[server_key].hostname)) == NULL)
{
ptr->my_errno= h_errno;
return MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE;
}
-
/* bind any port number */
localAddr.sin_family = AF_INET;
localAddr.sin_addr.s_addr = htonl(INADDR_ANY);
&flag, (socklen_t)sizeof(int));
}
+ if (ptr->send_size)
+ {
+ setsockopt(ptr->hosts[server_key].fd, SOL_SOCKET, SO_SNDBUF,
+ &ptr->send_size, (socklen_t)sizeof(int));
+ }
+
+ if (ptr->recv_size)
+ {
+ setsockopt(ptr->hosts[server_key].fd, SOL_SOCKET, SO_SNDBUF,
+ &ptr->recv_size, (socklen_t)sizeof(int));
+ }
+
/* connect to server */
test_connect:
if (connect(ptr->hosts[server_key].fd, (struct sockaddr *) &servAddr, sizeof(servAddr)) < 0)
}
ptr->connected++;
}
+ assert(ptr->hosts[server_key].stack_responses == 0);
}
return MEMCACHED_SUCCESS;