25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-07 14:58:56 +02:00

* src/ejabberd_socket.erl: All XML socket operations moved here

* src/ejabberd_s2s_in.erl: Likewise

SVN Revision: 600
This commit is contained in:
Alexey Shchepin 2006-09-05 04:36:01 +00:00
parent 4d7cc9301a
commit 0fe9caa304
2 changed files with 14 additions and 4 deletions

View File

@ -140,9 +140,10 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
SASL =
if
StateData#state.tls_enabled ->
case tls:get_peer_certificate(StateData#state.socket) of
case ejabberd_socket:get_peer_certificate(
StateData#state.socket) of
{ok, _Cert} ->
case tls:get_verify_result(
case ejabberd_socket:get_verify_result(
StateData#state.socket) of
0 ->
[{xmlelement, "mechanisms",
@ -222,9 +223,10 @@ wait_for_feature_request({xmlstreamelement, El}, StateData) ->
Auth = jlib:decode_base64(xml:get_cdata(Els)),
AuthDomain = jlib:nameprep(Auth),
AuthRes =
case tls:get_peer_certificate(StateData#state.socket) of
case ejabberd_socket:get_peer_certificate(
StateData#state.socket) of
{ok, Cert} ->
case tls:get_verify_result(
case ejabberd_socket:get_verify_result(
StateData#state.socket) of
0 ->
case AuthDomain of

View File

@ -18,6 +18,8 @@
send/2,
change_shaper/2,
get_sockmod/1,
get_peer_certificate/1,
get_verify_result/1,
close/1]).
-record(socket_state, {sockmod, socket, receiver}).
@ -93,6 +95,12 @@ change_shaper(SocketData, Shaper) ->
get_sockmod(SocketData) ->
SocketData#socket_state.sockmod.
get_peer_certificate(SocketData) ->
tls:get_peer_certificate(SocketData#socket_state.socket).
get_verify_result(SocketData) ->
tls:get_verify_result(SocketData#socket_state.socket).
close(SocketData) ->
ejabberd_receiver:close(SocketData#socket_state.receiver).