restore original socket flags after connecting

the socket may have been in non-blocking mode originally.
addressing #171
This commit is contained in:
rofl0r 2017-05-04 04:53:35 +01:00
parent bb3df1e440
commit ea8f4ff5dc
1 changed files with 2 additions and 0 deletions

View File

@ -700,8 +700,10 @@ int connect_proxy_chain(int sock, ip_type target_ip,
}
proxychains_write_log(TP " OK\n");
int flags = fcntl(sock, F_GETFL, 0);
dup2(ns, sock);
close(ns);
fcntl(sock, F_SETFL, flags);
return 0;
error:
if(ns != -1)