25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Fix compatibility of LDAP support with Erlang R16A (EJAB-1612)

As explained in Erlang/OTP git log:
eldap: Remove calls to undocumented asn1rt* functions.
We are about to remove the old asn1rt* modules, so we must remove
the calls that eldap make to them. Since the calls are just a
sanity check, we can just remove the calls. Just doing the decode
will do roughly the same tests and generate similar exceptions.
This commit is contained in:
Badlop 2013-02-04 10:31:54 +01:00
parent e500fd74ad
commit 2704378d43

View File

@ -761,7 +761,6 @@ gen_req({bind, RootDN, Passwd}) ->
%% {'EXIT', Reason} - Broke %% {'EXIT', Reason} - Broke
%%----------------------------------------------------------------------- %%-----------------------------------------------------------------------
recvd_packet(Pkt, S) -> recvd_packet(Pkt, S) ->
check_tag(Pkt),
case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
{ok,Msg} -> {ok,Msg} ->
Op = Msg#'LDAPMessage'.protocolOp, Op = Msg#'LDAPMessage'.protocolOp,
@ -874,7 +873,6 @@ get_op_rec(Id, Dict) ->
%% {'EXIT', Reason} - Broken packet %% {'EXIT', Reason} - Broken packet
%%----------------------------------------------------------------------- %%-----------------------------------------------------------------------
recvd_wait_bind_response(Pkt, S) -> recvd_wait_bind_response(Pkt, S) ->
check_tag(Pkt),
case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
{ok,Msg} -> {ok,Msg} ->
?DEBUG("~p", [Msg]), ?DEBUG("~p", [Msg]),
@ -907,12 +905,6 @@ cancel_timer(Timer) ->
end. end.
%%% Sanity check of received packet
check_tag(Data) ->
{_Tag, Data1, _Rb} = asn1rt_ber_bin:decode_tag(Data),
{{_Len,_Data2}, _Rb2} = asn1rt_ber_bin:decode_length(Data1),
ok.
close_and_retry(S, Timeout) -> close_and_retry(S, Timeout) ->
catch (S#eldap.sockmod):close(S#eldap.fd), catch (S#eldap.sockmod):close(S#eldap.fd),
Queue = dict:fold( Queue = dict:fold(