mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2025-09-06 17:06:58 +00:00
remove THREAD_SAFE ifdefs. from now on, pthreads are required.
additionally we have some explicit init and deinit routines for core.c now, so that we dont need to share variables with libproxychains.c.
This commit is contained in:
12
src/core.c
12
src/core.c
@ -34,10 +34,8 @@
|
||||
#include <sys/time.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
#ifdef THREAD_SAFE
|
||||
#include <pthread.h>
|
||||
#include "mutex.h"
|
||||
pthread_mutex_t hostdb_lock;
|
||||
#endif
|
||||
|
||||
#include "core.h"
|
||||
#include "common.h"
|
||||
@ -692,6 +690,14 @@ int connect_proxy_chain(int sock, ip_type target_ip,
|
||||
return -1;
|
||||
}
|
||||
|
||||
void core_initialize(void) {
|
||||
MUTEX_INIT(&hostdb_lock);
|
||||
}
|
||||
|
||||
void core_unload(void) {
|
||||
MUTEX_DESTROY(&hostdb_lock);
|
||||
}
|
||||
|
||||
static void gethostbyname_data_setstring(struct gethostbyname_data* data, char* name) {
|
||||
snprintf(data->addr_name, sizeof(data->addr_name), "%s", name);
|
||||
data->hostent_space.h_name = data->addr_name;
|
||||
|
Reference in New Issue
Block a user