summaryrefslogtreecommitdiff
path: root/main2.c
diff options
context:
space:
mode:
authorfadhil riyanto <me@fadev.org>2024-10-09 16:39:39 +0700
committerfadhil riyanto <me@fadev.org>2024-10-09 16:39:39 +0700
commitcb664718cfe5522d00bddba4e4a46588bcf17d70 (patch)
tree7b117717d371ba371140300804e7790edd2b8e5a /main2.c
parent000e9fad94f0bc7b2b7877fb7d98fc7e31e97ff5 (diff)
delete unused return
Signed-off-by: fadhil riyanto <me@fadev.org>
Diffstat (limited to 'main2.c')
-rw-r--r--main2.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/main2.c b/main2.c
index 4fb9057..3c45d76 100644
--- a/main2.c
+++ b/main2.c
@@ -352,7 +352,7 @@ static int create_sock_ret_fd6(struct sockaddr_storage *ss_addr)
static void signal_cb(int signum)
{
- printf("signal detected, exiting...\n");
+ printf("signal %d detected\n", signum);
if (signum == SIGINT) {
g_need_exit = 1;
@@ -552,6 +552,8 @@ static inline char* cmd2str(int cmd)
if (cmd == 3) {
return "udp";
}
+
+ return NULL;
}
static inline char* ip2str(int cmd)
@@ -567,9 +569,11 @@ static inline char* ip2str(int cmd)
if (cmd == 4) {
return "IPV6";
}
+
+ return NULL;
}
-static int socks5_handshake(int fd, char* buf, struct socks5_session *socks5_session)
+static void socks5_handshake(int fd, char* buf, struct socks5_session *socks5_session)
{
struct socks5_client_hello *c_hello = (struct socks5_client_hello*)buf;
log_debug("SOCKS_HANDSHAKE version: %d; nmethods: %d; methods: %d", c_hello->ver, c_hello->nmethods, c_hello->methods);
@@ -1154,7 +1158,7 @@ static void* start_exchange_data2_srv2client(void *fd_bridgeptr)
}
-static int start_exchange_data2(int client_fd, int target_fd)
+static void start_exchange_data2(int client_fd, int target_fd)
{
struct fd_bridge fd_bridge;
fd_bridge.need_exit = 0;
@@ -1214,12 +1218,12 @@ static int start_unpack_packet_no_epl(int fd, void* reserved, struct socks5_sess
socks5_send_connstate(fd, 0, next_req->atyp, next_req->dest,
next_req->port);
- exc_ret = start_exchange_data2(fd, cur_conn_clientfd);
- if (exc_ret == 1) {
- close(cur_conn_clientfd);
- close(fd);
+ start_exchange_data2(fd, cur_conn_clientfd);
+ // if (exc_ret == 1) {
+ // close(cur_conn_clientfd);
+ // close(fd);
return 0;
- }
+ // }
} else {
socks5_send_connstate(fd, 3, next_req->atyp, next_req->dest,
next_req->port);
@@ -1243,12 +1247,12 @@ static int start_unpack_packet_no_epl(int fd, void* reserved, struct socks5_sess
socks5_send_connstate(fd, 0, next_req->atyp, next_req->dest,
next_req->port);
- exc_ret = start_exchange_data2(fd, cur_conn_clientfd);
- if (exc_ret == 1) {
- close(cur_conn_clientfd);
- close(fd);
+ start_exchange_data2(fd, cur_conn_clientfd);
+ // if (exc_ret == 1) {
+ // close(cur_conn_clientfd);
+ // close(fd);
return 0;
- }
+ // }
} else {
socks5_send_connstate(fd, 3, next_req->atyp, next_req->dest,
next_req->port);
@@ -1258,6 +1262,8 @@ static int start_unpack_packet_no_epl(int fd, void* reserved, struct socks5_sess
}
}
}while (ret != 0);
+
+ return 0;
}