Projects
Kolab:16:TestingLinked
erlang-eimap
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 8
View file
erlang-eimap.spec
Changed
@@ -9,7 +9,7 @@ Name: erlang-%{realname} Version: 0.2.5 -Release: 2%{?dist} +Release: 5%{?dist} Summary: Erlang IMAP client Group: Development/Libraries License: GPLv3+ @@ -20,6 +20,7 @@ Source0: erlang-eimap-0.2.5.tar.gz Patch1: rebar-deps.patch +Patch2: untagged-commands.patch BuildRequires: erlang-goldrush >= 0.1.7 BuildRequires: erlang-lager >= 2.2.0 @@ -34,6 +35,7 @@ %prep %setup -q -n eimap-%{version} %patch1 -p1 +%patch2 -p1 %build rebar compile -v @@ -59,6 +61,9 @@ %{_libdir}/erlang/lib/%{realname}-%{version}/ebin/*.beam %changelog +* Tue Nov 7 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.2.5-5 +- Patch untagged commands + * Tue Jul 5 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.2.5-1 - Packaging of 0.2.5
View file
untagged-commands.patch
Added
@@ -0,0 +1,43 @@ +diff --git a/src/eimap_utils.erl b/src/eimap_utils.erl +index 163229b..230ab60 100644 +--- a/src/eimap_utils.erl ++++ b/src/eimap_utils.erl +@@ -156,14 +156,20 @@ remove_tag_from_response(Buffer, Tag, trust) -> + %% Private + split_command(<<>>) -> { <<>>, <<>>, <<>> }; + split_command(Buffer) -> +- End = eol_found(Buffer, binary:match(Buffer, <<"\r\n">>)), ++ {Terminated, End} = eol_found(Buffer, binary:match(Buffer, <<"\r\n">>)), + { Tag, CommandStart } = searched_in_buffer(Buffer, 0, End, binary:match(Buffer, <<" ">>, { scope, { 0, End } } )), +- { Command, DataStart } = searched_in_buffer(Buffer, CommandStart, End, binary:match(Buffer, <<" ">>, { scope, { CommandStart, End - CommandStart } } )), +- Data = binary:part(Buffer, DataStart, End - (DataStart)), +- { Tag, Command, Data }. ++ case Terminated of ++ true when End == CommandStart -> ++ %% when we have a newline, and the tag takes the entire line, the "tag" is actually the command ++ {<<>>, Tag, <<>>}; ++ _ -> ++ { Command, DataStart } = searched_in_buffer(Buffer, CommandStart, End, binary:match(Buffer, <<" ">>, { scope, { CommandStart, End - CommandStart } } )), ++ Data = binary:part(Buffer, DataStart, End - (DataStart)), ++ { Tag, Command, Data } ++ end. + +-eol_found(Buffer, nomatch) -> size(Buffer); +-eol_found(_Buffer, { MatchStart, _MatchLength }) -> MatchStart. ++eol_found(Buffer, nomatch) -> {false, size(Buffer)}; ++eol_found(_Buffer, { MatchStart, _MatchLength }) -> {true, MatchStart}. + + searched_in_buffer(Buffer, Start, End, nomatch) -> { binary:part(Buffer, Start, End - Start), End }; + searched_in_buffer(Buffer, Start, _End, { MatchStart, MatchLength } ) -> { binary:part(Buffer, Start, MatchStart - Start), MatchStart + MatchLength }. +diff --git a/test/eimap_utils_tests.erl b/test/eimap_utils_tests.erl +index 389be6f..81631c1 100644 +--- a/test/eimap_utils_tests.erl ++++ b/test/eimap_utils_tests.erl +@@ -79,6 +79,7 @@ split_command_into_components_test_() -> + Data = + + { { <<>>, <<>>, <<>> }, <<>> }, ++ { { <<>>, <<"DONE">>, <<>> }, <<"DONE\r\n">> }, + { { <<".">>, <<"LIST">>, <<"\"\" \"*\"">> }, <<". LIST \"\" \"*\"">> }, + { { <<"1">>, <<"STARTTLS">>, <<>> }, <<"1 STARTTLS">> }, + { { <<"1">>, <<"STARTTLS">>, <<>> }, <<"1 STARTTLS\r\n">> },
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +erlang-eimap (0.2.5-3) unstable; urgency=medium + + * Patch untagged commands + + -- Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Tue, 7 Nov 2017 10:30:50 +0100 + erlang-eimap (0.2.5-2) unstable; urgency=medium * Rebuild
View file
debian.series
Changed
@@ -1,1 +1,2 @@ rebar-deps.patch -p1 +untagged-commands.patch -p1
View file
erlang-eimap.dsc
Changed
@@ -2,7 +2,7 @@ Source: erlang-eimap Binary: erlang-eimap Architecture: any -Version: 0.2.5-2 +Version: 0.2.5-3 Maintainer: Christoph Erhardt <kolab@sicherha.de> Homepage: https://git.kolab.org/diffusion/EI/eimap.git Standards-Version: 3.9.6
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.