Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2015-06-14 12:53:33 +0300
committerrofl0r <retnyg@gmx.net>2015-06-14 12:53:33 +0300
commitafe6171cadabef7422c1a812af2e7b80cedd8436 (patch)
tree81f3a4124135e8144020af2a807587f6eb31d5ad
parent51b2eb91ce20d316af83a0530173c8c926c57f1b (diff)
clean up some debug ifdefs
-rw-r--r--src/debug.h2
-rw-r--r--src/libproxychains.c7
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 <stdio.h>
# 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);