From afe6171cadabef7422c1a812af2e7b80cedd8436 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sun, 14 Jun 2015 10:53:33 +0100 Subject: [PATCH] clean up some debug ifdefs --- src/debug.h | 2 ++ src/libproxychains.c | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/debug.h b/src/debug.h index 8bcf2e9..b9b5215 100644 --- a/src/debug.h +++ b/src/debug.h @@ -5,12 +5,14 @@ # include # define PSTDERR(fmt, args...) do { dprintf(2,fmt, ## args); } while(0) # define PDEBUG(fmt, args...) PSTDERR("DEBUG:"fmt, ## args) +# define DEBUGDECL(args...) args # include "core.h" void DUMP_PROXY_CHAIN(proxy_data *pchain, unsigned int count); #else # define PDEBUG(fmt, args...) do {} while (0) +# define DEBUGDECL(args...) # define DUMP_PROXY_CHAIN(args...) do {} while (0) #endif diff --git a/src/libproxychains.c b/src/libproxychains.c index b140398..d0b4cc7 100644 --- a/src/libproxychains.c +++ b/src/libproxychains.c @@ -312,9 +312,8 @@ int connect(int sock, const struct sockaddr *addr, unsigned int len) { int socktype = 0, flags = 0, ret = 0; socklen_t optlen = 0; ip_type dest_ip; -#ifdef DEBUG - char str[256]; -#endif + DEBUGDECL(char str[256]); + struct in_addr *p_addr_in; unsigned short port; size_t i; @@ -328,12 +327,10 @@ int connect(int sock, const struct sockaddr *addr, unsigned int len) { p_addr_in = &((struct sockaddr_in *) addr)->sin_addr; port = ntohs(((struct sockaddr_in *) addr)->sin_port); -#ifdef DEBUG // PDEBUG("localnet: %s; ", inet_ntop(AF_INET,&in_addr_localnet, str, sizeof(str))); // PDEBUG("netmask: %s; " , inet_ntop(AF_INET, &in_addr_netmask, str, sizeof(str))); PDEBUG("target: %s\n", inet_ntop(AF_INET, p_addr_in, str, sizeof(str))); PDEBUG("port: %d\n", port); -#endif // check if connect called from proxydns remote_dns_connect = (ntohl(p_addr_in->s_addr) >> 24 == remote_dns_subnet);