]> granicus.if.org Git - ejabberd/commitdiff
Send stream trailer before closing s2s connection
authorHolger Weiss <holger@zedat.fu-berlin.de>
Sat, 26 Apr 2014 22:28:42 +0000 (00:28 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Sat, 26 Apr 2014 22:28:42 +0000 (00:28 +0200)
When aborting an incoming s2s connection due to certificate verification
errors, send a stream trailer before closing the socket.

src/ejabberd_s2s_in.erl

index 3eb0b71ccd1ae0c9d5d6badc604463feebe2ee07..aa55c2e631b20aa891ecc40b193522d4ca09359b 100644 (file)
@@ -294,8 +294,9 @@ wait_for_stream({xmlstreamstart, _Name, Attrs},
                ?INFO_MSG("Closing s2s connection: ~s <--> ~s (~s)",
                          [StateData#state.server, RemoteServer, CertError]),
                send_text(StateData,
-                         xml:element_to_binary(?SERRT_POLICY_VIOLATION(<<"en">>,
-                                                                       CertError))),
+                         <<(xml:element_to_binary(?SERRT_POLICY_VIOLATION(<<"en">>,
+                                                                          CertError)))/binary,
+                           (?STREAM_TRAILER)/binary>>),
                {atomic, Pid} =
                    ejabberd_s2s:find_connection(jlib:make_jid(<<"">>,
                                                               Server, <<"">>),