mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-09 23:02:52 +08:00
clean up some debug ifdefs
This commit is contained in:
parent
51b2eb91ce
commit
afe6171cad
@ -5,12 +5,14 @@
|
|||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# define PSTDERR(fmt, args...) do { dprintf(2,fmt, ## args); } while(0)
|
# define PSTDERR(fmt, args...) do { dprintf(2,fmt, ## args); } while(0)
|
||||||
# define PDEBUG(fmt, args...) PSTDERR("DEBUG:"fmt, ## args)
|
# define PDEBUG(fmt, args...) PSTDERR("DEBUG:"fmt, ## args)
|
||||||
|
# define DEBUGDECL(args...) args
|
||||||
|
|
||||||
# include "core.h"
|
# include "core.h"
|
||||||
void DUMP_PROXY_CHAIN(proxy_data *pchain, unsigned int count);
|
void DUMP_PROXY_CHAIN(proxy_data *pchain, unsigned int count);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# define PDEBUG(fmt, args...) do {} while (0)
|
# define PDEBUG(fmt, args...) do {} while (0)
|
||||||
|
# define DEBUGDECL(args...)
|
||||||
# define DUMP_PROXY_CHAIN(args...) do {} while (0)
|
# define DUMP_PROXY_CHAIN(args...) do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -312,9 +312,8 @@ int connect(int sock, const struct sockaddr *addr, unsigned int len) {
|
|||||||
int socktype = 0, flags = 0, ret = 0;
|
int socktype = 0, flags = 0, ret = 0;
|
||||||
socklen_t optlen = 0;
|
socklen_t optlen = 0;
|
||||||
ip_type dest_ip;
|
ip_type dest_ip;
|
||||||
#ifdef DEBUG
|
DEBUGDECL(char str[256]);
|
||||||
char str[256];
|
|
||||||
#endif
|
|
||||||
struct in_addr *p_addr_in;
|
struct in_addr *p_addr_in;
|
||||||
unsigned short port;
|
unsigned short port;
|
||||||
size_t i;
|
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;
|
p_addr_in = &((struct sockaddr_in *) addr)->sin_addr;
|
||||||
port = ntohs(((struct sockaddr_in *) addr)->sin_port);
|
port = ntohs(((struct sockaddr_in *) addr)->sin_port);
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
// PDEBUG("localnet: %s; ", inet_ntop(AF_INET,&in_addr_localnet, str, sizeof(str)));
|
// 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("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("target: %s\n", inet_ntop(AF_INET, p_addr_in, str, sizeof(str)));
|
||||||
PDEBUG("port: %d\n", port);
|
PDEBUG("port: %d\n", port);
|
||||||
#endif
|
|
||||||
|
|
||||||
// check if connect called from proxydns
|
// check if connect called from proxydns
|
||||||
remote_dns_connect = (ntohl(p_addr_in->s_addr) >> 24 == remote_dns_subnet);
|
remote_dns_connect = (ntohl(p_addr_in->s_addr) >> 24 == remote_dns_subnet);
|
||||||
|
Loading…
Reference in New Issue
Block a user