void finish_connecting(connection_t *c) {
ifdebug(CONNECTIONS) logger(LOG_INFO, "Connected to %s (%s)", c->name, c->hostname);
- if(proxytype != PROXY_EXEC)
- configure_tcp(c);
-
c->last_ping_time = now;
send_id(c);
exit(result);
#else
logger(LOG_ERR, "Proxy type exec not supported on this platform!");
- return false;
+ return;
#endif
}
void do_outgoing_connection(connection_t *c) {
char *address, *port, *space;
- struct addrinfo *proxyai;
+ struct addrinfo *proxyai = NULL;
int result;
if(!c->outgoing) {
if(!proxytype) {
c->socket = socket(c->address.sa.sa_family, SOCK_STREAM, IPPROTO_TCP);
configure_tcp(c);
- } if(proxytype == PROXY_EXEC) {
+ } else if(proxytype == PROXY_EXEC) {
do_outgoing_pipe(c, proxyhost);
- } else {
+ } else {
proxyai = str2addrinfo(proxyhost, proxyport, SOCK_STREAM);
if(!proxyai)
goto begin;
ifdebug(CONNECTIONS) logger(LOG_INFO, "Using proxy at %s port %s", proxyhost, proxyport);
c->socket = socket(proxyai->ai_family, SOCK_STREAM, IPPROTO_TCP);
+ configure_tcp(c);
}
if(c->socket == -1) {