mirror of
https://github.com/Yonle/bostr.git
synced 2025-11-18 18:07:49 +01:00
bouncer: disable eose_timeout by default or when unspecified
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
@@ -35,6 +35,7 @@ module.exports = (ws, req, onClose) => {
|
|||||||
ws.pendingEOSE = new Map(); // each contain subID
|
ws.pendingEOSE = new Map(); // each contain subID
|
||||||
ws.EOSETimeout = new Map(); // per subID
|
ws.EOSETimeout = new Map(); // per subID
|
||||||
ws.reconnectTimeout = new Set(); // relays timeout() before reconnection. Only use after client disconnected.
|
ws.reconnectTimeout = new Set(); // relays timeout() before reconnection. Only use after client disconnected.
|
||||||
|
//ws.subalias = new Map();
|
||||||
ws.pubkey = null;
|
ws.pubkey = null;
|
||||||
|
|
||||||
if (authorized_keys?.length) {
|
if (authorized_keys?.length) {
|
||||||
@@ -170,6 +171,7 @@ module.exports = (ws, req, onClose) => {
|
|||||||
|
|
||||||
// CL - Set up EOSE timeout
|
// CL - Set up EOSE timeout
|
||||||
function timeoutEOSE(id, subid) {
|
function timeoutEOSE(id, subid) {
|
||||||
|
if (!eose_timeout) return;
|
||||||
const c = csess.get(id);
|
const c = csess.get(id);
|
||||||
if (!c) return;
|
if (!c) return;
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,10 @@ module.exports = {
|
|||||||
pause_on_limit: false,
|
pause_on_limit: false,
|
||||||
|
|
||||||
// EOSE timeout in milliseconds
|
// EOSE timeout in milliseconds
|
||||||
eose_timeout: 2300,
|
// Setting as 0 will disable this feature.
|
||||||
|
//
|
||||||
|
// Enabling this may make CPU usage to be intensive
|
||||||
|
eose_timeout: 0,
|
||||||
|
|
||||||
// Maximum of received EOSE from relays to send EOSE to client.
|
// Maximum of received EOSE from relays to send EOSE to client.
|
||||||
// Normally, waiting EOSE from 3 relays should be enough. Leaving it with 0 equals wait for every established relays.
|
// Normally, waiting EOSE from 3 relays should be enough. Leaving it with 0 equals wait for every established relays.
|
||||||
|
|||||||
Reference in New Issue
Block a user