Skip to content

Commit 686cd86

Browse files
committed
fix(IMAP): Use a non-round number for socket timeout to decrease race conditions where both the server and the client wait for the same time
1 parent 5df4abe commit 686cd86

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

imap-core/lib/imap-connection.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const EventEmitter = require('events').EventEmitter;
1313
const packageInfo = require('../../package');
1414
const errors = require('../../lib/errors.js');
1515

16-
const SOCKET_TIMEOUT = 5 * 60 * 1000;
16+
// Shift timeout by 37 seconds (randomly selected by myself, no specific meaning) to
17+
// avoid race conditions where both the client and the server wait for 5 minutes
18+
const SOCKET_TIMEOUT = 5 * 60 * 1000 + 37 * 1000;
1719

1820
/**
1921
* Creates a handler for new socket

0 commit comments

Comments
 (0)