Skip to content

Commit

Permalink
#26
Browse files Browse the repository at this point in the history
  • Loading branch information
UldisRinkevichs authored Feb 23, 2023
1 parent bc7862b commit 139af7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/ftpserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ void *list_thread(PTHCONTEXT tctx)
struct dirent *entry;
PFTPCONTEXT context = tctx->context;

pthread_detach(pthread_self());
pthread_mutex_lock(&context->MTLock);
pthread_cleanup_push(cleanup_handler, tctx);
ret = 0;
Expand Down Expand Up @@ -667,6 +668,7 @@ void *retr_thread(PTHCONTEXT tctx)
gnutls_session_t TLS_datasession;
PFTPCONTEXT context = tctx->context;

pthread_detach(pthread_self());
pthread_mutex_lock(&context->MTLock);
pthread_cleanup_push(cleanup_handler, context);

Expand Down Expand Up @@ -1093,6 +1095,7 @@ void *stor_thread(PTHCONTEXT tctx)
gnutls_session_t TLS_datasession;
PFTPCONTEXT context = tctx->context;

pthread_detach(pthread_self());
pthread_mutex_lock(&context->MTLock);
pthread_cleanup_push(cleanup_handler, tctx);

Expand Down Expand Up @@ -1563,6 +1566,7 @@ void *ftp_client_thread(SOCKET s)
struct sockaddr_in laddr;
pthread_mutexattr_t m_attr;

pthread_detach(pthread_self());
memset(&rcvbuf, 0, sizeof(rcvbuf));
memset(&ctx, 0, sizeof(ctx));

Expand Down

0 comments on commit 139af7c

Please sign in to comment.