diff options
author | Paweł Chmielowski <pawel@process-one.net> | 2022-02-02 18:33:45 +0100 |
---|---|---|
committer | Paweł Chmielowski <pawel@process-one.net> | 2022-02-02 18:33:45 +0100 |
commit | 11c725018bdd156a5a31129656448782aef3e81a (patch) | |
tree | e5200174aeedb105978daff41e88a1429933cd26 /src | |
parent | One more place where we need to handle socket field not being available (diff) |
Make dialyzer happy
Diffstat (limited to 'src')
-rw-r--r-- | src/ejabberd_c2s.erl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 3033501c..a62cac79 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -289,8 +289,10 @@ process_terminated(#{sid := SID, jid := JID, user := U, server := S, resource := Reason) -> Status = format_reason(State, Reason), ?INFO_MSG("(~ts) Closing c2s session for ~ts: ~ts", - [case State of #{socket := Socket} -> xmpp_socket:pp(Socket); _ -> <<"unknown">> end, - jid:encode(JID), Status]), + [case maps:find(socket, State) of + {ok, Socket} -> xmpp_socket:pp(Socket); + _ -> <<"unknown">> + end, jid:encode(JID), Status]), Pres = #presence{type = unavailable, from = JID, to = jid:remove_resource(JID)}, @@ -307,8 +309,10 @@ process_terminated(#{sid := SID, jid := JID, user := U, server := S, resource := State1; process_terminated(#{stop_reason := {tls, _}} = State, Reason) -> ?WARNING_MSG("(~ts) Failed to secure c2s connection: ~ts", - [case State of #{socket := Socket} -> xmpp_socket:pp(Socket); _ -> <<"unknown">> end, -format_reason(State, Reason)]), + [case maps:find(socket, State) of + {ok, Socket} -> xmpp_socket:pp(Socket); + _ -> <<"unknown">> + end, format_reason(State, Reason)]), State; process_terminated(State, _Reason) -> State. |