diff options
Diffstat (limited to 'lib/eldap/src/eldap.erl')
-rw-r--r-- | lib/eldap/src/eldap.erl | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/eldap/src/eldap.erl b/lib/eldap/src/eldap.erl index 22d816c8c8..7edd012263 100644 --- a/lib/eldap/src/eldap.erl +++ b/lib/eldap/src/eldap.erl @@ -30,7 +30,8 @@ parse_ldap_url/1, paged_result_control/1, paged_result_control/2, - paged_result_cookie/1]). + paged_result_cookie/1, + info/1]). -export([neverDerefAliases/0, derefInSearching/0, derefFindingBaseObj/0, derefAlways/0]). @@ -155,6 +156,13 @@ controlling_process(Handle, Pid) when is_pid(Handle), is_pid(Pid) -> recv(Handle). %%% -------------------------------------------------------------------- +%%% Return LDAP socket information +%%% -------------------------------------------------------------------- +info(Handle) when is_pid(Handle) -> + send(Handle, info), + recv(Handle). + +%%% -------------------------------------------------------------------- %%% Authenticate ourselves to the Directory %%% using simple authentication. %%% @@ -608,6 +616,18 @@ loop(Cpid, Data) -> send(From, Result), ?MODULE:loop(Cpid, Data); + {From, info} -> + SocketType = + case Data#eldap.ldaps of + true -> + ssl; + false -> + tcp + end, + Res = #{socket => Data#eldap.fd, socket_type => SocketType}, + send(From, Res), + ?MODULE:loop(Cpid, Data); + {Cpid, 'EXIT', Reason} -> ?PRINT("Got EXIT from Cpid, reason=~p~n",[Reason]), exit(Reason); @@ -618,7 +638,6 @@ loop(Cpid, Data) -> end. - %%% -------------------------------------------------------------------- %%% startTLS Request %%% -------------------------------------------------------------------- |