Simplify code for splitting auth string in cyrsasl
This may fix problem from issue #2296
This commit is contained in:
parent
0a67cdfb16
commit
b2095ebcfe
|
@ -81,15 +81,8 @@ prepare(ClientIn) ->
|
||||||
_ -> error
|
_ -> error
|
||||||
end.
|
end.
|
||||||
|
|
||||||
parse(S) -> parse1(binary_to_list(S), "", []).
|
parse(S) ->
|
||||||
|
binary:split(S, <<0>>, [global]).
|
||||||
parse1([0 | Cs], S, T) ->
|
|
||||||
parse1(Cs, "", [list_to_binary(lists:reverse(S)) | T]);
|
|
||||||
parse1([C | Cs], S, T) -> parse1(Cs, [C | S], T);
|
|
||||||
%parse1([], [], T) ->
|
|
||||||
% lists:reverse(T);
|
|
||||||
parse1([], S, T) ->
|
|
||||||
lists:reverse([list_to_binary(lists:reverse(S)) | T]).
|
|
||||||
|
|
||||||
parse_domain(S) -> parse_domain1(binary_to_list(S), "", []).
|
parse_domain(S) -> parse_domain1(binary_to_list(S), "", []).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue