debug: fix DUMP_PROXY_CHAIN() hack

pull/348/head
rofl0r 2020-09-20 17:00:10 +01:00
parent acf2f4725d
commit 121c582d9c
2 changed files with 8 additions and 6 deletions

View File

@ -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)) {

View File

@ -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