]> granicus.if.org Git - ejabberd/commitdiff
Fix compatibility of LDAP support with Erlang R16A (EJAB-1612)
authorBadlop <badlop@process-one.net>
Mon, 4 Feb 2013 09:31:54 +0000 (10:31 +0100)
committerBadlop <badlop@process-one.net>
Mon, 4 Feb 2013 09:31:54 +0000 (10:31 +0100)
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.

src/eldap/eldap.erl

index 265845e908594c13b087d7de532f40608d8f3f36..e18d2e22af9b6f6f49a3d97ed76890621c487839 100644 (file)
@@ -761,7 +761,6 @@ gen_req({bind, RootDN, Passwd}) ->
 %%  {'EXIT', Reason} - Broke
 %%-----------------------------------------------------------------------
 recvd_packet(Pkt, S) ->
-    check_tag(Pkt),
     case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
        {ok,Msg} ->
            Op = Msg#'LDAPMessage'.protocolOp,
@@ -874,7 +873,6 @@ get_op_rec(Id, Dict) ->
 %%  {'EXIT', Reason} - Broken packet
 %%-----------------------------------------------------------------------
 recvd_wait_bind_response(Pkt, S) ->
-    check_tag(Pkt),
     case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
        {ok,Msg} ->
            ?DEBUG("~p", [Msg]),
@@ -907,12 +905,6 @@ cancel_timer(Timer) ->
     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) ->
     catch (S#eldap.sockmod):close(S#eldap.fd),
     Queue = dict:fold(