]> granicus.if.org Git - ejabberd/commitdiff
Let ejabberd_c2s handle <session/> IQ
authorHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 19 Feb 2017 21:43:10 +0000 (22:43 +0100)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 19 Feb 2017 21:43:10 +0000 (22:43 +0100)
This fixes the counting of incoming stanzas for stream management.

src/ejabberd_c2s.erl
src/xmpp_stream_in.erl

index 036bea79ebdb7fbfda37971f856cd5131ae76741..dd022149613b6faf2e4ae60d04988ff603a572dd 100644 (file)
@@ -448,6 +448,13 @@ handle_authenticated_packet(Pkt, #{lserver := LServer, jid := JID,
     case Pkt2 of
        drop ->
            State2;
+       #iq{type = set, sub_els = [_]} ->
+           case xmpp:get_subtag(Pkt1, #xmpp_session{}) of
+               #xmpp_session{} ->
+                   send(State2, xmpp:make_iq_result(Pkt1));
+               _ ->
+                   check_privacy_then_route(State2, Pkt1)
+           end;
        #presence{to = #jid{luser = LUser, lserver = LServer,
                            lresource = <<"">>}} ->
            process_self_presence(State2, Pkt2);
index 7d9b0dc88dcfd2c97cbcea62f18c0c255d3f2d2f..501db04ef8f8a92b3ab8ff938afd705dbfc45299 100644 (file)
@@ -577,20 +577,9 @@ process_unauthenticated_packet(Pkt, #{mod := Mod} = State) ->
     end.
 
 -spec process_authenticated_packet(xmpp_element(), state()) -> state().
-process_authenticated_packet(Pkt, #{xmlns := NS, mod := Mod} = State) ->
+process_authenticated_packet(Pkt, #{mod := Mod} = State) ->
     Pkt1 = set_lang(Pkt, State),
     case set_from_to(Pkt1, State) of
-       {ok, #iq{type = set, sub_els = [_]} = Pkt2} when NS == ?NS_CLIENT ->
-           case xmpp:get_subtag(Pkt2, #xmpp_session{}) of
-               #xmpp_session{} ->
-                   send_pkt(State, xmpp:make_iq_result(Pkt2));
-               _ ->
-                   try Mod:handle_authenticated_packet(Pkt2, State)
-                   catch _:undef ->
-                           Err = xmpp:err_service_unavailable(),
-                           send_error(State, Pkt, Err)
-                   end
-           end;
        {ok, Pkt2} ->
            try Mod:handle_authenticated_packet(Pkt2, State)
            catch _:undef ->