summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 4c0934a87bd..3ff6af441e2 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -63,9 +63,13 @@ static VALUE rb_eSocket;
#ifdef SOCKS
VALUE rb_cSOCKSSocket;
+#ifdef SOCKS5
+#include <socks.h>
+#else
void SOCKSinit();
int Rconnect();
#endif
+#endif
#define INET_CLIENT 0
#define INET_SERVER 1
@@ -631,11 +635,14 @@ ruby_connect(fd, sockaddr, len, socks)
# define NONBLOCKING O_NONBLOCK
#endif
#endif
+#ifdef SOCKS5
+ if (!socks)
+#endif
fcntl(fd, F_SETFL, mode|NONBLOCKING);
#endif /* HAVE_FCNTL */
for (;;) {
-#ifdef SOCKS
+#if defined(SOCKS) && !defined(SOCKS5)
if (socks) {
status = Rconnect(fd, sockaddr, len);
}