Fix reporting dialback failures

This commit is contained in:
Evgeniy Khramtsov 2017-01-18 18:26:31 +03:00
parent 60a09285b7
commit 044e55b98e
2 changed files with 3 additions and 3 deletions

View 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) ->

View 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