mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2024-12-22 12:18:47 +00:00
simplify log func
This commit is contained in:
parent
e5e87c8f22
commit
71e15e2edd
15
src/core.c
15
src/core.c
@ -175,21 +175,16 @@ static void encode_base_64(char *src, char *dest, int max_len) {
|
||||
*dest++ = 0;
|
||||
}
|
||||
|
||||
#define LOG_BUFF 1024*20
|
||||
|
||||
int proxychains_write_log(char *str, ...) {
|
||||
char buff[LOG_BUFF];
|
||||
void proxychains_write_log(char *str, ...) {
|
||||
char buff[1024*20];
|
||||
va_list arglist;
|
||||
FILE *log_file;
|
||||
log_file = stderr;
|
||||
if(!proxychains_quiet_mode) {
|
||||
va_start(arglist, str);
|
||||
vsprintf(buff, str, arglist);
|
||||
vsnprintf(buff, sizeof(buff), str, arglist);
|
||||
va_end(arglist);
|
||||
fprintf(log_file, "%s", buff);
|
||||
fflush(log_file);
|
||||
fprintf(stderr, "%s", buff);
|
||||
fflush(stderr);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
static int write_n_bytes(int fd, char *buff, size_t size) {
|
||||
|
@ -102,7 +102,7 @@ int connect_proxy_chain (int sock, ip_type target_ip, unsigned short target_port
|
||||
proxy_data * pd, unsigned int proxy_count, chain_type ct,
|
||||
unsigned int max_chain );
|
||||
|
||||
int proxychains_write_log(char *str,...);
|
||||
void proxychains_write_log(char *str, ...);
|
||||
|
||||
typedef int (*connect_t)(int, const struct sockaddr *, socklen_t);
|
||||
typedef struct hostent* (*gethostbyname_t)(const char *);
|
||||
|
Loading…
Reference in New Issue
Block a user