mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Get rid of asn1rt calls
This commit is contained in:
parent
d53a54d900
commit
4575649e10
@ -828,7 +828,7 @@ send_command(Command, From, S) ->
|
|||||||
Message = #'LDAPMessage'{messageID = Id,
|
Message = #'LDAPMessage'{messageID = Id,
|
||||||
protocolOp = {Name, Request}},
|
protocolOp = {Name, Request}},
|
||||||
?DEBUG("~p~n", [{Name, Request}]),
|
?DEBUG("~p~n", [{Name, Request}]),
|
||||||
{ok, Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage',
|
{ok, Bytes} = 'ELDAPv3':encode('LDAPMessage',
|
||||||
Message),
|
Message),
|
||||||
case (S#eldap.sockmod):send(S#eldap.fd, Bytes) of
|
case (S#eldap.sockmod):send(S#eldap.fd, Bytes) of
|
||||||
ok ->
|
ok ->
|
||||||
@ -863,11 +863,10 @@ gen_req({modify_dn, Entry, NewRDN, DelOldRDN,
|
|||||||
#'ModifyDNRequest'{entry = Entry, newrdn = NewRDN,
|
#'ModifyDNRequest'{entry = Entry, newrdn = NewRDN,
|
||||||
deleteoldrdn = DelOldRDN, newSuperior = NewSup}};
|
deleteoldrdn = DelOldRDN, newSuperior = NewSup}};
|
||||||
gen_req({modify_passwd, DN, Passwd}) ->
|
gen_req({modify_passwd, DN, Passwd}) ->
|
||||||
{ok, ReqVal} = asn1rt:encode('ELDAPv3',
|
{ok, ReqVal} = 'ELDAPv3':encode('PasswdModifyRequestValue',
|
||||||
'PasswdModifyRequestValue',
|
#'PasswdModifyRequestValue'{userIdentity = DN,
|
||||||
#'PasswdModifyRequestValue'{userIdentity = DN,
|
newPasswd =
|
||||||
newPasswd =
|
Passwd}),
|
||||||
Passwd}),
|
|
||||||
{extendedReq,
|
{extendedReq,
|
||||||
#'ExtendedRequest'{requestName = ?passwdModifyOID,
|
#'ExtendedRequest'{requestName = ?passwdModifyOID,
|
||||||
requestValue = iolist_to_binary(ReqVal)}};
|
requestValue = iolist_to_binary(ReqVal)}};
|
||||||
@ -887,7 +886,7 @@ gen_req({bind, RootDN, Passwd}) ->
|
|||||||
%% {'EXIT', Reason} - Broke
|
%% {'EXIT', Reason} - Broke
|
||||||
%%-----------------------------------------------------------------------
|
%%-----------------------------------------------------------------------
|
||||||
recvd_packet(Pkt, S) ->
|
recvd_packet(Pkt, S) ->
|
||||||
case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
|
case 'ELDAPv3':decode('LDAPMessage', Pkt) of
|
||||||
{ok, Msg} ->
|
{ok, Msg} ->
|
||||||
Op = Msg#'LDAPMessage'.protocolOp,
|
Op = Msg#'LDAPMessage'.protocolOp,
|
||||||
?DEBUG("~p", [Op]),
|
?DEBUG("~p", [Op]),
|
||||||
@ -1005,7 +1004,7 @@ 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) ->
|
||||||
case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
|
case 'ELDAPv3':decode('LDAPMessage', Pkt) of
|
||||||
{ok, Msg} ->
|
{ok, Msg} ->
|
||||||
?DEBUG("~p", [Msg]),
|
?DEBUG("~p", [Msg]),
|
||||||
check_id(S#eldap.id, Msg#'LDAPMessage'.messageID),
|
check_id(S#eldap.id, Msg#'LDAPMessage'.messageID),
|
||||||
@ -1152,7 +1151,7 @@ bind_request(Socket, S) ->
|
|||||||
Message = #'LDAPMessage'{messageID = Id,
|
Message = #'LDAPMessage'{messageID = Id,
|
||||||
protocolOp = {bindRequest, Req}},
|
protocolOp = {bindRequest, Req}},
|
||||||
?DEBUG("Bind Request Message:~p~n", [Message]),
|
?DEBUG("Bind Request Message:~p~n", [Message]),
|
||||||
{ok, Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage',
|
{ok, Bytes} = 'ELDAPv3':encode('LDAPMessage',
|
||||||
Message),
|
Message),
|
||||||
case (S#eldap.sockmod):send(Socket, Bytes) of
|
case (S#eldap.sockmod):send(Socket, Bytes) of
|
||||||
ok -> {ok, S#eldap{id = Id}};
|
ok -> {ok, S#eldap{id = Id}};
|
||||||
|
Loading…
Reference in New Issue
Block a user