From: Paweł Chmielowski Date: Tue, 14 May 2019 15:32:12 +0000 (+0200) Subject: Don't put duplicate polling attribute in bosh payload X-Git-Tag: 19.05~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=122cb4b9594041487f9bb18c683531d7105ce2f9;p=ejabberd Don't put duplicate polling attribute in bosh payload This fixes issue #2790 --- diff --git a/src/ejabberd_bosh.erl b/src/ejabberd_bosh.erl index c8dde4b0f..578466bba 100644 --- a/src/ejabberd_bosh.erl +++ b/src/ejabberd_bosh.erl @@ -324,10 +324,10 @@ wait_for_session(#body{attrs = Attrs} = Req, From, NewKey = get_attr(newkey, Attrs), Type = get_attr(type, Attrs), Requests = Hold + 1, - {PollTime, Polling} = if Wait == 0, Hold == 0 -> - {erlang:timestamp(), [{polling, ?DEFAULT_POLLING}]}; - true -> {undefined, []} - end, + PollTime = if + Wait == 0, Hold == 0 -> erlang:timestamp(); + true -> undefined + end, MaxPause = gen_mod:get_module_opt(State#state.host, mod_bosh, max_pause), Resp = #body{attrs = @@ -337,8 +337,7 @@ wait_for_session(#body{attrs = Attrs} = Req, From, {hold, Hold}, {'xmpp:restartlogic', true}, {requests, Requests}, {secure, true}, {maxpause, MaxPause}, {'xmlns:xmpp', ?NS_BOSH}, - {'xmlns:stream', ?NS_STREAM}, {from, State#state.host} - | Polling]}, + {'xmlns:stream', ?NS_STREAM}, {from, State#state.host}]}, {ShaperState, _} = ejabberd_shaper:update(State#state.shaper_state, Req#body.size), State1 = State#state{wait_timeout = Wait,