From f7206a772a8602ed44d19371c055d4cc2d0fba1f Mon Sep 17 00:00:00 2001 From: James Bunton Date: Thu, 28 Jul 2016 09:27:53 +1000 Subject: [PATCH] Style changes --- socks5server.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/socks5server.c b/socks5server.c index 972687d..4e1f6fd 100644 --- a/socks5server.c +++ b/socks5server.c @@ -16,6 +16,9 @@ #include #include +#ifndef VERSION +#define VERSION "dev" +#endif /*********** @@ -254,10 +257,7 @@ void* proxy_copy_from_dest(void* _data) { return NULL; } -bool proxy_create_copy_from_dest_thread( - int dst_fd, - int src_fd -) { +bool proxy_create_copy_from_dest_thread(int dst_fd, int src_fd) { struct proxy_copy_from_dest_data* data = smalloc(sizeof(struct proxy_copy_from_dest_data)); data->dst_fd = dst_fd; data->src_fd = src_fd; @@ -461,12 +461,12 @@ bool proxy_handle_request(int* dst_fd, int fd) { return false; } switch (addr_type) { - case 1: - return proxy_ipv4_handle_request(dst_fd, fd); - case 3: - return proxy_dns_handle_request(dst_fd, fd); - case 4: - return proxy_ipv6_handle_request(dst_fd, fd); + case 1: + return proxy_ipv4_handle_request(dst_fd, fd); + case 3: + return proxy_dns_handle_request(dst_fd, fd); + case 4: + return proxy_ipv6_handle_request(dst_fd, fd); } proxy_write_error_response(fd, 8); @@ -591,11 +591,10 @@ void rewrite_ipv4_mapped_address(struct sockaddr_storage* addr) { } struct in6_addr* addr_data = &((struct sockaddr_in6*)addr)->sin6_addr; - if (!( - ((uint32_t*)(addr_data))[0] == 0 && - ((uint32_t*)(addr_data))[1] == 0 && - ((uint32_t*)(addr_data))[2] == htonl(0xffff) - )) { + if (!(((uint32_t*)(addr_data))[0] == 0 && + ((uint32_t*)(addr_data))[1] == 0 && + ((uint32_t*)(addr_data))[2] == htonl(0xffff))) + { return; } -- 2.39.2