}
cs->state = CS_INPROCESS;
- return TC_ServerConnect( cs );
+ return TC_ServerConnect( cs, 0 );
}
u_int32_t
-TC_ServerConnect( TC_Connection *cs ) {
+TC_ServerConnect( TC_Connection *cs, int timeout ) {
struct pollfd pfd;
int ret;
pfd.fd = cs->fd;
pfd.events = POLLOUT;
pfd.revents = 0;
- ret = poll( &pfd, 1, 0 );
+ ret = poll( &pfd, 1, timeout );
if ( ret<0 ) {
tlog( TL_CRIT, "TC_ServerConnect: poll: %s",
strerror(errno));
u_int32_t ret = TC_ServerInitConnect( cs );
while( ret == CS_INPROCESS ) {
- ret = TC_ServerConnect(cs);
+ ret = TC_ServerConnect(cs, 100);
}
if ( ret != CS_CONNECTED )