]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't delete .work file if there are outstanding requests
authorNick Porter <nick@portercomputing.co.uk>
Fri, 13 Oct 2023 11:16:37 +0000 (12:16 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 13 Oct 2023 11:16:37 +0000 (12:16 +0100)
src/listen/detail/proto_detail_work.c

index 2fd6139895fbbe1531c1bce1cc0f017b3468bacc..c14d92905821882bef37c65bbf2617cf6b0699a6 100644 (file)
@@ -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;