mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2025-09-08 03:57:03 +00:00
preliminary first fork-safe version
instead of allocating memory in the child, we now use the allocator thread to do all the necessary allocations himself. additionally we provide a clean API to query the ip <-> dns mapping. these functions connect via a pipe to the allocator thread, and exchange messages. further cleanup is needed, but it seems to work so far. thread-safety is not yet guaranteed. closes #1
This commit is contained in:
@ -96,12 +96,9 @@ static void* load_sym(char* symname, void* proxyfunc) {
|
||||
#include "allocator_thread.h"
|
||||
|
||||
static void do_init(void) {
|
||||
MUTEX_INIT(&internal_ips_lock, NULL);
|
||||
MUTEX_INIT(&hostdb_lock, NULL);
|
||||
internal_ips = shm_realloc(NULL, 0, sizeof(internal_ip_lookup_table));
|
||||
assert(internal_ips);
|
||||
memset(internal_ips, 0, sizeof(internal_ip_lookup_table));
|
||||
at_init(&internal_ips->mi.addr, &internal_ips->mi.oldsz, &internal_ips->mi.newsz);
|
||||
srand(time(NULL));
|
||||
MUTEX_INIT(&hostdb_lock);
|
||||
at_init();
|
||||
|
||||
/* read the config file */
|
||||
get_chain_data(proxychains_pd, &proxychains_proxy_count, &proxychains_ct);
|
||||
|
Reference in New Issue
Block a user