Skip to content

Commit 98b9192

Browse files
trekawektschak909
authored andcommitted
Extract DIR_HANDLE_TIMEOUT to a constant. Set it to 5 minutes.
1 parent 3a37e2e commit 98b9192

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define MAX_TCP_CONN 4096 /* maximum number of TCP connections */
3131
#define SESSION_TIMEOUT 600 /* Sessions are thrown out after no contact for this many seconds. 0 = no timeout */
3232
#define CONN_TIMEOUT 600 /* TCP connections are thrown out after no contact for this many seconds. 0 = no timeout */
33+
#define DIR_HANDLE_TIMEOUT 300 /* How long the traversal dir handles are cached. */
3334
#define TNFS_HEADERSZ 4 /* minimum header size */
3435
#define TNFS_MAX_PAYLOAD (MAXMSGSZ - TNFS_HEADERSZ - 1) /* Maximum usuable payload in a UDP datagram (-1 for status byte) */
3536
#define MAX_TNFSPATH 256 /* maximum path length */

src/directory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ int _tnfs_find_free_dir_handle(Session *s, const char *path, uint8_t diropt, uin
12191219
{
12201220
continue;
12211221
}
1222-
if (dhandle->loaded && now > dhandle->open_at + 60)
1222+
if (dhandle->loaded && now > dhandle->open_at + DIR_HANDLE_TIMEOUT)
12231223
{
12241224
#ifdef DEBUG
12251225
fprintf(stderr, "freeing stale handle=%d\n", i);

0 commit comments

Comments
 (0)