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

Simplify code for splitting auth string in cyrsasl

This may fix problem from issue #2296
This commit is contained in:
Paweł Chmielowski 2018-02-26 09:36:56 +01:00
parent 0a67cdfb16
commit b2095ebcfe

View File

@ -81,15 +81,8 @@ prepare(ClientIn) ->
_ -> error
end.
parse(S) -> parse1(binary_to_list(S), "", []).
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(S) ->
binary:split(S, <<0>>, [global]).
parse_domain(S) -> parse_domain1(binary_to_list(S), "", []).