Commit fe0fb4c2 authored by rswindell's avatar rswindell
Browse files

Unique data/temp sub-directory names to avoid multi-instance FTP-QWK

pack/unpack conflicts.
parent d78473d9
......@@ -1020,6 +1020,7 @@ void event_thread(void* arg)
memcpy(&sbbs->cfg,&scfg,sizeof(scfg_t));
sprintf(sbbs->cfg.temp_dir, "temp/%lX", sbbs_random(~0));
prep_dir(sbbs->cfg.data_dir, sbbs->cfg.temp_dir);
// Read TIME.DAB
......@@ -1581,8 +1582,10 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
if(node_num>0) {
strcpy(cfg.node_dir, cfg.node_path[node_num-1]);
prep_dir(cfg.node_dir, cfg.temp_dir);
} else
} else {
sprintf(cfg.temp_dir, "temp/%lX", sbbs_random(~0));
prep_dir(cfg.data_dir, cfg.temp_dir);
}
terminated = false;
event_thread_running = false;
......@@ -1998,6 +2001,9 @@ sbbs_t::~sbbs_t()
lprintf("%s destructor begin", node);
if(!cfg.node_num)
rmdir(cfg.temp_dir);
if(client_socket_dup!=INVALID_SOCKET)
closesocket(client_socket_dup); /* close duplicate handle */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment