From 0383e7e973f7a67d36bc26d924ed1e83d46eddf7 Mon Sep 17 00:00:00 2001 From: patrick xia Date: Sat, 24 Oct 2020 16:47:26 -0700 Subject: [PATCH] Fix the rest of the globals and restore 65536 size for proxy_fds --- connect_socks.c | 3 +++ connect_socks.h | 4 ++-- my_connect.c | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/connect_socks.c b/connect_socks.c index 4f3ec0b..ed44acf 100644 --- a/connect_socks.c +++ b/connect_socks.c @@ -7,6 +7,9 @@ #include #include #include + +int proxy_fds[65536]; +int len_proxy_fds = 0; char * socks_host = NULL; char * socks_port = NULL; diff --git a/connect_socks.h b/connect_socks.h index ce6fec3..11bdd24 100644 --- a/connect_socks.h +++ b/connect_socks.h @@ -8,8 +8,8 @@ #include #ifndef CONNECT_SOCKS_H #define CONNECT_SOCKS_H -int proxy_fds[256]; -int len_proxy_fds; +extern int proxy_fds[]; +extern int len_proxy_fds; struct addrinfo *get_socks_addr(char *host, char *port); int get_socks_fd(struct addrinfo *res); int connect_socks(int sockfd, struct addrinfo *res); diff --git a/my_connect.c b/my_connect.c index 5db7b4a..3d49f18 100644 --- a/my_connect.c +++ b/my_connect.c @@ -4,6 +4,7 @@ #include #include #include + int socket(int domain, int type, int protocol) { char * socks_h = getenv("SOCKS_HOST"); char * socks_p = getenv("SOCKS_PORT");