]> granicus.if.org Git - ejabberd/commitdiff
Don't put duplicate polling attribute in bosh payload
authorPaweł Chmielowski <pchmielowski@process-one.net>
Tue, 14 May 2019 15:32:12 +0000 (17:32 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Tue, 14 May 2019 15:32:19 +0000 (17:32 +0200)
This fixes issue #2790

src/ejabberd_bosh.erl

index c8dde4b0fc6153924deeecdce61c0b513082b590..578466bba3f3beeb241810803c814c75ab6626b0 100644 (file)
@@ -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,