]> granicus.if.org Git - ejabberd/commitdiff
Fix reporting dialback failures
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Wed, 18 Jan 2017 15:26:31 +0000 (18:26 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Wed, 18 Jan 2017 15:26:31 +0000 (18:26 +0300)
src/mod_s2s_dialback.erl
src/xmpp_stream_in.erl

index 7e952f5766c05eef4820bb20d757ab7282b5ce5c..4be58d42cdd83d74defc6f69ab6db02e47b5a3f8 100644 (file)
@@ -240,7 +240,7 @@ s2s_out_packet(#{server := LServer, remote_server := RServer} = State,
            ejabberd_s2s_out:establish(State2);
        _ ->
            Reason = format_error(Result),
-           ejabberd_s2s_out:handle_auth_failure(<<"dialback">>, Reason, State1)
+           ejabberd_s2s_out:handle_auth_failure(<<"dialback">>, {auth, Reason}, State1)
     end;
 s2s_out_packet(State, Pkt) when is_record(Pkt, db_result);
                                is_record(Pkt, db_verify) ->
index b84a971f776fb8ee0ee9e8e6534d6fee51e4bd8e..dd135df1e8b16d606b7038cddf5877096a9da73e 100644 (file)
@@ -63,7 +63,7 @@
 -callback handle_authenticated_packet(xmpp_element(), state()) -> state().
 -callback handle_unbinded_packet(xmpp_element(), state()) -> state().
 -callback handle_auth_success(binary(), binary(), module(), state()) -> state().
--callback handle_auth_failure(binary(), binary(), atom(), state()) -> state().
+-callback handle_auth_failure(binary(), binary(), binary(), state()) -> state().
 -callback handle_send(xmpp_element(), ok | {error, inet:posix()}, state()) -> state().
 -callback handle_recv(fxml:xmlel(), xmpp_element() | {error, term()}, state()) -> state().
 -callback handle_timeout(state()) -> state().
@@ -664,7 +664,7 @@ process_handshake(#handshake{data = Digest},
            end;
        false ->
            State1 = try Mod:handle_auth_failure(
-                          RemoteServer, <<"handshake">>, 'not-authorized', State)
+                          RemoteServer, <<"handshake">>, <<"not authorized">>, State)
                     catch _:undef -> State
                     end,
            case is_disconnected(State1) of