diff options
author | rofl0r <rofl0r@users.noreply.github.com> | 2020-09-20 19:00:10 +0300 |
---|---|---|
committer | rofl0r <rofl0r@users.noreply.github.com> | 2020-09-20 19:00:10 +0300 |
commit | 121c582d9cb559be65a27932f3fba62dae656fbd (patch) | |
tree | 4b2aca13e26c321476c48f9d4e2faef2e2b2a9c5 | |
parent | acf2f4725df2a7df7f47fdb94826ab0231d71f4a (diff) |
debug: fix DUMP_PROXY_CHAIN() hack
-rw-r--r-- | src/debug.c | 2 | ||||
-rw-r--r-- | src/debug.h | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/debug.c b/src/debug.c index 013571c..314aadd 100644 --- a/src/debug.c +++ b/src/debug.c @@ -5,7 +5,7 @@ # include "debug.h" #include <arpa/inet.h> -void DUMP_PROXY_CHAIN(proxy_data *pchain, unsigned int count) { +void dump_proxy_chain(proxy_data *pchain, unsigned int count) { char ip_buf[INET6_ADDRSTRLEN]; for (; count; pchain++, count--) { if(!inet_ntop(pchain->ip.is_v6?AF_INET6:AF_INET,pchain->ip.addr.v6,ip_buf,sizeof ip_buf)) { diff --git a/src/debug.h b/src/debug.h index b9b5215..40a93d2 100644 --- a/src/debug.h +++ b/src/debug.h @@ -1,15 +1,13 @@ #ifndef DEBUG_H #define DEBUG_H -#ifdef DEBUG # include <stdio.h> + +#ifdef DEBUG # 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); - +# define DUMP_PROXY_CHAIN(A, B) dump_proxy_chain(A, B) #else # define PDEBUG(fmt, args...) do {} while (0) # define DEBUGDECL(args...) @@ -18,5 +16,9 @@ void DUMP_PROXY_CHAIN(proxy_data *pchain, unsigned int count); # define PFUNC() do { PDEBUG("pid[%d]:%s\n", getpid(), __FUNCTION__); } while(0) +#include "core.h" +void dump_proxy_chain(proxy_data *pchain, unsigned int count); + + #endif |