From 5f4b783bf3d8ff785e812101ddb4c7f490bfdf6a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 19 Apr 2016 17:20:39 +0200 Subject: MUC: Accept missing form as "instant room" request (fixes #377) --- plugins/muc/muc.lib.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 5879c256..f8e8f74d 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -668,6 +668,14 @@ function room_mt:process_form(origin, stanza) if form.attr.type == "cancel" then origin.send(st.reply(stanza)); return; end if form.attr.type ~= "submit" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Not a submitted form")); return; end + if form.tags[1] == nil then + -- instant room + if self.save then self:save(true); end + origin.send(st.reply(stanza)); + return true; + end + + local fields = self:get_form_layout():data(form); if fields.FORM_TYPE ~= "http://jabber.org/protocol/muc#roomconfig" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Form is not of type room configuration")); return; end -- cgit v1.2.3 From 2bf3239f769a9ea49d8aa7cfaa62bc034ddc4773 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 19 Apr 2016 17:24:00 +0200 Subject: net.server_event: Re-add write event if writebuffer is non-empty after write (eg due to writes from ondrain callback) (fixes #661) --- net/server_event.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/server_event.lua b/net/server_event.lua index d505825d..1c6f1547 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -548,6 +548,10 @@ do elseif interface.eventreadtimeout then return EV_WRITE, EV_TIMEOUT end + if interface.writebuffer ~= 0 then + -- data possibly written from ondrain + return EV_WRITE, cfg.WRITE_TIMEOUT + end interface.eventwrite = nil return -1 elseif byte and (err == "timeout" or err == "wantwrite") then -- want write again -- cgit v1.2.3