processone/ejabberd — pull request #184 by weiss (2014-04-27 23:39:03+00:00)
Title: Fix handling of certificate verification errors for incoming s2s connections

This changes the handling of certificate verification errors for incoming s2s connections in two ways:

1. A stream trailer is sent before closing the socket.
2. Outgoing connections are no longer looked up and closed, because the `ejabberd_s2s:find_connection/2` call actually created one or more *new* connections if less than `max_s2s_connections` connections were found. Then, no more than one of those (possibly new) connections were stopped by the `ejabberd_s2s_out:stop_connection/1` call. This behavior doesn't make much sense, and unless I'm overlooking something, there's no reason to bother with outgoing connections here anyway.