configure_tcp(c);
- /* Connect */
-
- result = connect(c->socket, &c->address.sa, SALEN(c->address.sa));
-
- if(result == -1) {
- if(sockinprogress(sockerrno)) {
- c->status.connecting = true;
- return;
- }
-
- closesocket(c->socket);
-
- ifdebug(CONNECTIONS) logger(LOG_ERR, "%s: %s", c->hostname, sockstrerror(sockerrno));
-
- goto begin;
- }
-
- finish_connecting(c);
-
+ c->status.connecting = true;
return;
}
configure_tcp(c);
+ mutex_lock(&mutex);
connection_add(c);
c->allow_request = ID;
logger(LOG_ERR, "create_thread() failed: %s", strerror(errno));
abort();
}
+ mutex_unlock(&mutex);
}
}