Skip to content

Commit

Permalink
Fix the rest of the globals and restore 65536 size for proxy_fds
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickxia committed Oct 24, 2020
1 parent 3ab6b43 commit 0383e7e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions connect_socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <dlfcn.h>

int proxy_fds[65536];
int len_proxy_fds = 0;
char * socks_host = NULL;
char * socks_port = NULL;

Expand Down
4 changes: 2 additions & 2 deletions connect_socks.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <dlfcn.h>
#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);
Expand Down
1 change: 1 addition & 0 deletions my_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>

int socket(int domain, int type, int protocol) {
char * socks_h = getenv("SOCKS_HOST");
char * socks_p = getenv("SOCKS_PORT");
Expand Down

0 comments on commit 0383e7e

Please sign in to comment.