From: Nick Porter Date: Fri, 13 Oct 2023 11:16:37 +0000 (+0100) Subject: Don't delete .work file if there are outstanding requests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2367b540346052ecb38acf994df80caa214331e7;p=thirdparty%2Ffreeradius-server.git Don't delete .work file if there are outstanding requests --- diff --git a/src/listen/detail/proto_detail_work.c b/src/listen/detail/proto_detail_work.c index 2fd6139895f..c14d9290582 100644 --- a/src/listen/detail/proto_detail_work.c +++ b/src/listen/detail/proto_detail_work.c @@ -747,14 +747,14 @@ static int mod_close_internal(proto_detail_work_thread_t *thread) pthread_mutex_unlock(&thread->file_parent->worker_mutex); } - DEBUG("Closing and deleting detail worker file %s", thread->name); + DEBUG("Closing %sdetail worker file %s", thread->outstanding == 0 ? "and deleting " : "", thread->name); #ifdef NOTE_REVOKE fr_event_fd_delete(thread->el, thread->fd, FR_EVENT_FILTER_VNODE); #endif fr_event_fd_delete(thread->el, thread->fd, FR_EVENT_FILTER_IO); - unlink(thread->filename_work); + if (thread->outstanding == 0) unlink(thread->filename_work); close(thread->fd); thread->fd = -1;