diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c index 559d304c0deefc8203b737979c55f3947dc84431..55dbbfc6cd707e9af71036f5b72c89f35410a486 100644 --- a/src/sbbs3/ftpsrvr.c +++ b/src/sbbs3/ftpsrvr.c @@ -8,7 +8,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2012 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2014 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -208,10 +208,9 @@ static void client_off(SOCKET sock) static int32_t thread_up(BOOL setuid) { - int32_t count = protected_uint32_adjust(&thread_count,1); if(startup!=NULL && startup->thread_up!=NULL) startup->thread_up(startup->cbdata,TRUE, setuid); - return count; + return thread_count.value; } static int32_t thread_down(void) @@ -1918,6 +1917,7 @@ static void filexfer(SOCKADDR_IN* addr, SOCKET ctrl_sock, SOCKET pasv_sock, SOCK xfer->dir=dir; xfer->desc=desc; SAFECOPY(xfer->filename,filename); + protected_uint32_adjust(&thread_count,1); if(receiving) result=_beginthread(receive_thread,0,(void*)xfer); else @@ -4636,6 +4636,7 @@ void DLLCALL ftp_server(void* arg) do { + protected_uint32_adjust(&thread_count,1); thread_up(FALSE /* setuid */); status("Initializing"); @@ -4893,6 +4894,7 @@ void DLLCALL ftp_server(void* arg) ftp->socket=client_socket; ftp->client_addr=client_addr; + protected_uint32_adjust(&thread_count,1); _beginthread(ctrl_thread, 0, ftp); served++; }