X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_socket.c;h=b889bca6a9d1ffb60edd48b399df71949d03cfee;hp=2d1ecc50e83f40ed5d03590e49a8a7a6e6e13182;hb=a0c544df5d882bea812fb0ef648cdee98939e89c;hpb=0a84f9cb8f52f2d2b4f03a5ad5ef9dfcd3509033 diff --git a/src/net_socket.c b/src/net_socket.c index 2d1ecc50..b889bca6 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -1,7 +1,7 @@ /* net_socket.c -- Handle various kinds of sockets. Copyright (C) 1998-2005 Ivo Timmermans, - 2000-2012 Guus Sliepen + 2000-2013 Guus Sliepen 2006 Scott Lamb 2009 Florian Forster @@ -64,7 +64,7 @@ static void configure_tcp(connection_t *c) { unsigned long arg = 1; if(ioctlsocket(c->socket, FIONBIO, &arg) != 0) { - logger(LOG_ERR, "ioctlsocket for %s: %d", c->hostname, sockstrerror(sockerrno)); + logger(LOG_ERR, "ioctlsocket for %s: %s", c->hostname, sockstrerror(sockerrno)); } #endif @@ -294,9 +294,6 @@ void retry_outgoing(outgoing_t *outgoing) { 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); @@ -314,7 +311,7 @@ static void do_outgoing_pipe(connection_t *c, char *command) { if(fork()) { c->socket = fd[0]; close(fd[1]); - logger(LOG_DEBUG, "Using proxy %s", command); + ifdebug(CONNECTIONS) logger(LOG_DEBUG, "Using proxy %s", command); return; } @@ -419,6 +416,7 @@ begin: 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) {