]> granicus.if.org Git - ejabberd/commitdiff
Don't perform useless resourceprep
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Mon, 27 Feb 2017 10:58:57 +0000 (13:58 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Mon, 27 Feb 2017 10:58:57 +0000 (13:58 +0300)
rebar.config
src/xmpp_stream_in.erl

index bc8fc4d05003138ab8aef9676df393beb3e63624..c04b075b7baabbce46986331c73005d2bf2b3322 100644 (file)
@@ -24,7 +24,7 @@
         {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.10"}}},
         {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.7"}}},
         {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.21"}}},
-        {xmpp, ".*", {git, "https://github.com/processone/xmpp", "f5cbd6dc0f3ec786b33a7e708979ed27dfbbb0ec"}},
+        {xmpp, ".*", {git, "https://github.com/processone/xmpp", "4aaed37a16fc21be505553aabf9f47a48b8af027"}},
         {stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.9"}}},
         {esip, ".*", {git, "https://github.com/processone/esip", {tag, "1.0.10"}}},
         {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.8"}}},
index 501db04ef8f8a92b3ab8ff938afd705dbfc45299..84576bd2f25bb9babff74434d09431982af0bb47 100644 (file)
@@ -592,25 +592,17 @@ process_authenticated_packet(Pkt, #{mod := Mod} = State) ->
 
 -spec process_bind(xmpp_element(), state()) -> state().
 process_bind(#iq{type = set, sub_els = [_]} = Pkt,
-            #{xmlns := ?NS_CLIENT, mod := Mod, lang := Lang} = State) ->
+            #{xmlns := ?NS_CLIENT, mod := Mod} = State) ->
     case xmpp:get_subtag(Pkt, #bind{}) of
        #bind{resource = R} ->
-           case jid:resourceprep(R) of
-               error ->
-                   Txt = <<"Malformed resource">>,
-                   Err = xmpp:err_bad_request(Txt, Lang),
-                   send_error(State, Pkt, Err);
-               _ ->
-                   case Mod:bind(R, State) of
-                       {ok, #{user := U,
-                              server := S,
-                              resource := NewR} = State1} when NewR /= <<"">> ->
-                           Reply = #bind{jid = jid:make(U, S, NewR)},
-                           State2 = send_pkt(State1, xmpp:make_iq_result(Pkt, Reply)),
-                           process_stream_established(State2);
-                       {error, #stanza_error{} = Err, State1} ->
-                           send_error(State1, Pkt, Err)
-                   end
+           case Mod:bind(R, State) of
+               {ok, #{user := U, server := S, resource := NewR} = State1}
+                 when NewR /= <<"">> ->
+                   Reply = #bind{jid = jid:make(U, S, NewR)},
+                   State2 = send_pkt(State1, xmpp:make_iq_result(Pkt, Reply)),
+                   process_stream_established(State2);
+               {error, #stanza_error{} = Err, State1} ->
+                   send_error(State1, Pkt, Err)
            end;
        _ ->
            try Mod:handle_unbinded_packet(Pkt, State)