From 92d92e3350dec7fda48d4708e93bb02bc174e455 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Thu, 25 May 2023 10:54:19 +0200 Subject: [PATCH] Fix: i misunderstood the parameter s2s_close_timeout. And removing a duplicate hook. --- CHANGELOG.md | 1 - .../mod_websocket_s2s_peertubelivechat.lua | 4 ++-- server/lib/prosody/config/content.ts | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d99917..d334bd4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,6 @@ TODO: when sanitizing remote chat endpoint, check that the domain is the same as TODO: only compatible with Prosody 0.12.x. So it should be documented for people using «system Prosody». And i should fix the ARM AppImage. TODO: it seems that in some case A->B can be Websocket, and B->A direct S2S. Check if this is fine. And maybe we can optimise some code, by allowing directS2S event if current server dont accept it. TODO: check that the keepalive is working with websocket s2s. It seems the connection is often close and reopened. -TODO: seems that the stream close timeout is too short. TODO: alpha.2 version force Websocket S2S when available, even if s2s is possible. Revert this before releasing. TODO?: always generate self-signed certificates. Could be used for outgoing s2s? diff --git a/prosody-modules/mod_websocket_s2s_peertubelivechat/mod_websocket_s2s_peertubelivechat.lua b/prosody-modules/mod_websocket_s2s_peertubelivechat/mod_websocket_s2s_peertubelivechat.lua index 74c0a7a6..b6f06f03 100644 --- a/prosody-modules/mod_websocket_s2s_peertubelivechat/mod_websocket_s2s_peertubelivechat.lua +++ b/prosody-modules/mod_websocket_s2s_peertubelivechat/mod_websocket_s2s_peertubelivechat.lua @@ -365,6 +365,8 @@ end local function keepalive(event) local session = event.session; if session.open_stream == session_open_stream then + local log = session.log or log + log("debug", "Sending a keepalive on outgoint websocket s2s"); return session.conn:write(build_frame({ opcode = 0x9, FIN = true })); end end @@ -639,8 +641,6 @@ module:hook("server-stopping", function(event) end, -100); function module.add_host(module) - module:hook("s2s-read-timeout", keepalive, -0.9); - module:hook("route/remote", route_to_new_session, -2); module:depends("http"); diff --git a/server/lib/prosody/config/content.ts b/server/lib/prosody/config/content.ts index c3445822..bf8fb0ae 100644 --- a/server/lib/prosody/config/content.ts +++ b/server/lib/prosody/config/content.ts @@ -296,8 +296,6 @@ class ProsodyConfigContent { this.global.set('peertubelivechat_instance_url', publicServerUrl) this.global.add('modules_enabled', 'websocket_s2s_peertubelivechat') - // s2s_close_timeout must be set accordingly with nginx timeout (30s) - this.global.set('s2s_close_timeout', 29) // FIXME: seems to be necessary to add the module on the muc host, so that dialback can trigger route/remote. this.muc.add('modules_enabled', 'websocket_s2s_peertubelivechat')