Overview

Request 2725 (accepted)

Check in 0.4.2

Submit package Kolab:Winterfell / erlang-eimap to package Kolab:16 / erlang-eimap

erlang-eimap.spec Changed
x
 
1
@@ -8,7 +8,7 @@
2
 %define lock_version() %{1}%{?_isa} = %(rpm -q --queryformat "%%{VERSION}" %{1})
3
 
4
 Name:           erlang-%{realname}
5
-Version:        0.4.0
6
+Version:        0.4.2
7
 Release:        1%{?dist}
8
 Summary:        Erlang IMAP client
9
 Group:          Development/Libraries
10
@@ -19,16 +19,16 @@
11
 %endif
12
 Source0:        erlang-eimap-%{version}.tar.gz
13
 
14
-Patch1:         untagged-commands.patch
15
-Patch2:         eimap-0.4.0-otp-20.patch
16
-Patch3:         make-things-easy-for-rebar3.patch
17
+# Keep rebar3 from downloading dependencies, we want package provide ones.
18
+Patch1:         nodeps.patch
19
 
20
 BuildRequires: erlang-goldrush
21
-BuildRequires: erlang-lager
22
+BuildRequires: erlang-lager >= 3.1.0
23
 BuildRequires: erlang-rebar3 >= 3.3.2
24
 
25
 Requires:       %lock_version erlang-erts
26
 Requires:       %lock_version erlang-stdlib
27
+Requires:       %lock_version erlang-lager
28
 
29
 %description
30
 IMAP client library for Erlang
31
@@ -37,8 +37,6 @@
32
 %setup -q -n eimap-%{version}
33
 
34
 %patch1 -p1
35
-%patch2 -p1
36
-%patch3 -p1
37
 
38
 %build
39
 DEBUG=1
40
@@ -78,6 +76,13 @@
41
 %{_libdir}/erlang/lib/%{realname}-%{version}/ebin/*.beam
42
 
43
 %changelog
44
+
45
+* Wed Apr 15 2020 Christian Mollekopf <mollekopf@kolabsys.com> - 0.4.2-1
46
+- Upstream release 0.4.2
47
+
48
+* Sat Mar 28 2020 Christian Mollekopf <mollekopf@kolabsys.com> - 0.4.1-1
49
+- Upstream release 0.4.1
50
+
51
 * Sun Apr 08 2018 Christoph Erhardt <kolab@sicherha.de> - 0.4.0-1
52
 - Upstream release 0.4.0
53
 
54
eimap-0.4.0-otp-20.patch Deleted
15
 
1
@@ -1,13 +0,0 @@
2
-diff -ur eimap-0.4.0.orig/rebar.config eimap-0.4.0/rebar.config
3
---- eimap-0.4.0.orig/rebar.config  2016-11-11 15:49:11.000000000 +0100
4
-+++ eimap-0.4.0/rebar.config   2018-08-13 16:19:45.864891814 +0200
5
-@@ -1,8 +1,7 @@
6
- %% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
7
- %% ex: ft=erlang ts=4 sw=4 et
8
- 
9
--{erl_opts, [warnings_as_errors, {parse_transform, lager_transform}]}.
10
--{deps, [ lager ]}.
11
-+{erl_opts, [{parse_transform, lager_transform}]}.
12
- 
13
- { erl_first_files, ["src/eimap_command.erl"] }.
14
- {sub_dirs, [
15
make-things-easy-for-rebar3.patch Deleted
28
 
1
@@ -1,26 +0,0 @@
2
-diff -ur eimap-0.4.0.orig/rebar.config eimap-0.4.0/rebar.config
3
---- eimap-0.4.0.orig/rebar.config  2016-11-11 15:49:11.000000000 +0100
4
-+++ eimap-0.4.0/rebar.config   2016-11-23 10:34:12.227835779 +0100
5
-@@ -15,3 +15,8 @@
6
- %%{require_otp_vsn, "17"}.
7
- {pre_hooks, [{clean, "rm -rf ebin priv erl_crash.dump"}]}.
8
- 
9
-+{ relx, [ { release, { eimap, "0.4.0" }, [eimap]},
10
-+                { dev_mode, false },
11
-+                { include_erts, false }
12
-+         ]
13
-+}.
14
-diff -ur eimap-0.4.0.orig/src/eimap.app.src eimap-0.4.0/src/eimap.app.src
15
---- eimap-0.4.0.orig/src/eimap.app.src 2016-11-11 15:49:11.000000000 +0100
16
-+++ eimap-0.4.0/src/eimap.app.src  2016-11-21 12:35:31.302170628 +0100
17
-@@ -10,9 +10,7 @@
18
-                    crypto,
19
-                    ssl,
20
-                    compiler,
21
--                   syntax_tools,
22
--                   goldrush,
23
--                   lager
24
-+                   syntax_tools
25
-                   ]
26
-   },
27
-   { env, [ ]},
28
nodeps.patch Added
14
 
1
@@ -0,0 +1,12 @@
2
+diff --git a/rebar.config b/rebar.config
3
+index 33e4158..0b5d970 100644
4
+--- a/rebar.config
5
++++ b/rebar.config
6
+@@ -2,7 +2,6 @@
7
+ %% ex: ft=erlang ts=4 sw=4 et
8
+ 
9
+ {erl_opts, [{parse_transform, lager_transform}]}.
10
+-{deps, [ lager ]}.
11
+ 
12
+ { erl_first_files, ["src/eimap_command.erl"] }.
13
+ {sub_dirs, [
14
untagged-commands.patch Deleted
45
 
1
@@ -1,43 +0,0 @@
2
-diff --git a/src/eimap_utils.erl b/src/eimap_utils.erl
3
-index 163229b..230ab60 100644
4
---- a/src/eimap_utils.erl
5
-+++ b/src/eimap_utils.erl
6
-@@ -156,14 +156,20 @@ remove_tag_from_response(Buffer, Tag, trust) ->
7
- %% Private
8
- split_command(<<>>) -> { <<>>, <<>>, <<>> };
9
- split_command(Buffer) ->
10
--    End = eol_found(Buffer, binary:match(Buffer, <<"\r\n">>)),
11
-+    {Terminated, End} = eol_found(Buffer, binary:match(Buffer, <<"\r\n">>)),
12
-     { Tag, CommandStart } = searched_in_buffer(Buffer, 0, End, binary:match(Buffer, <<" ">>, [ { scope, { 0, End } } ])),
13
--    { Command, DataStart } = searched_in_buffer(Buffer, CommandStart, End, binary:match(Buffer, <<" ">>, [ { scope, { CommandStart, End - CommandStart  } } ])),
14
--    Data = binary:part(Buffer, DataStart, End - (DataStart)),
15
--    { Tag, Command, Data }.
16
-+    case Terminated of
17
-+         true when End == CommandStart ->
18
-+            %% when we have a newline, and the tag takes the entire line, the "tag" is actually the command
19
-+            {<<>>, Tag, <<>>};
20
-+         _ ->
21
-+            { Command, DataStart } = searched_in_buffer(Buffer, CommandStart, End, binary:match(Buffer, <<" ">>, [ { scope, { CommandStart, End - CommandStart  } } ])),
22
-+            Data = binary:part(Buffer, DataStart, End - (DataStart)),
23
-+            { Tag, Command, Data }
24
-+    end.
25
- 
26
--eol_found(Buffer, nomatch) -> size(Buffer);
27
--eol_found(_Buffer, { MatchStart, _MatchLength }) -> MatchStart.
28
-+eol_found(Buffer, nomatch) -> {false, size(Buffer)};
29
-+eol_found(_Buffer, { MatchStart, _MatchLength }) -> {true, MatchStart}.
30
- 
31
- searched_in_buffer(Buffer, Start, End, nomatch) -> { binary:part(Buffer, Start, End - Start), End };
32
- searched_in_buffer(Buffer, Start, _End, { MatchStart, MatchLength } ) -> { binary:part(Buffer, Start, MatchStart - Start), MatchStart + MatchLength }.
33
-diff --git a/test/eimap_utils_tests.erl b/test/eimap_utils_tests.erl
34
-index 389be6f..81631c1 100644
35
---- a/test/eimap_utils_tests.erl
36
-+++ b/test/eimap_utils_tests.erl
37
-@@ -79,6 +79,7 @@ split_command_into_components_test_() ->
38
-     Data =
39
-     [
40
-         { { <<>>, <<>>, <<>> }, <<>> },
41
-+        { { <<>>, <<"DONE">>, <<>> }, <<"DONE\r\n">> },
42
-         { { <<".">>, <<"LIST">>, <<"\"\" \"*\"">> }, <<". LIST \"\" \"*\"">> },
43
-         { { <<"1">>, <<"STARTTLS">>, <<>> }, <<"1 STARTTLS">> },
44
-         { { <<"1">>, <<"STARTTLS">>, <<>> }, <<"1 STARTTLS\r\n">> },
45
debian.changelog Changed
17
 
1
@@ -1,3 +1,15 @@
2
+erlang-eimap (0.4.2-1.1) unstable; urgency=medium
3
+
4
+  * Package the 0.4.2 release
5
+
6
+ -- Christian Mollekopf <mollekopf@kolabsys.com>  Wed, 15 Apr 2020 00:44:10 +0200
7
+
8
+erlang-eimap (0.4.1-1.1) unstable; urgency=medium
9
+
10
+  * Package the 0.4.1 release
11
+
12
+ -- Christian Mollekopf <mollekopf@kolabsys.com>  Sat, 28 Mar 2020 00:44:10 +0200
13
+
14
 erlang-eimap (0.4.0-1.1) unstable; urgency=medium
15
 
16
   * Package the 0.4.0 release
17
debian.series Changed
5
 
1
@@ -1,2 +1,1 @@
2
-untagged-commands.patch -p1
3
-eimap-0.4.0-otp-20.patch -p1
4
+nodeps.patch -p1
5
erlang-eimap-0.4.2.tar.gz/.arcconfig Added
5
 
1
@@ -0,0 +1,3 @@
2
+{
3
+    "phabricator.uri": "https://git.kolab.org"
4
+}
5
erlang-eimap-0.4.0.tar.gz/CHANGELOG.md -> erlang-eimap-0.4.2.tar.gz/CHANGELOG.md Changed
14
 
1
@@ -11,6 +11,12 @@
2
 ### Fixed
3
 ### Security
4
 
5
+
6
+## [0.4.1] - 2020-03-28
7
+### Added
8
+- Enabled tcp keepalive
9
+- Support for untagged commands
10
+
11
 ## [0.4.0] - 2016-11-11
12
 ### Added
13
 - optional timeout on eimap objects for server delay
14
erlang-eimap-0.4.0.tar.gz/rebar.config -> erlang-eimap-0.4.2.tar.gz/rebar.config Changed
25
 
1
@@ -1,17 +1,20 @@
2
 %% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
3
 %% ex: ft=erlang ts=4 sw=4 et
4
 
5
-{erl_opts, [warnings_as_errors, {parse_transform, lager_transform}]}.
6
+{erl_opts, [{parse_transform, lager_transform}]}.
7
 {deps, [ lager ]}.
8
 
9
 { erl_first_files, ["src/eimap_command.erl"] }.
10
 {sub_dirs, [
11
     "src",
12
-    "rel",
13
     "tests"
14
  ]}.
15
 {cover_enabled, true}.
16
 
17
 %%{require_otp_vsn, "17"}.
18
 {pre_hooks, [{clean, "rm -rf ebin priv erl_crash.dump"}]}.
19
-
20
+{ relx, [ { release, { eimap, "0.4.2" }, [eimap]},
21
+                { dev_mode, false },
22
+                { include_erts, false }
23
+         ]
24
+}.
25
erlang-eimap-0.4.0.tar.gz/rebar3 -> erlang-eimap-0.4.2.tar.gz/rebar3 Changed
erlang-eimap-0.4.0.tar.gz/src/eimap.app.src -> erlang-eimap-0.4.2.tar.gz/src/eimap.app.src Changed
18
 
1
@@ -2,7 +2,7 @@
2
 {application, eimap,
3
  [
4
   { description, "IMAP client implementation" },
5
-  { vsn, "0.4.0" },
6
+  { vsn, "0.4.2" },
7
   { registered, [] },
8
   { applications, [
9
                    kernel,
10
@@ -11,7 +11,6 @@
11
                    ssl,
12
                    compiler,
13
                    syntax_tools,
14
-                   goldrush,
15
                    lager
16
                   ]
17
   },
18
erlang-eimap-0.4.0.tar.gz/src/eimap.erl -> erlang-eimap-0.4.2.tar.gz/src/eimap.erl Changed
48
 
1
@@ -211,6 +211,21 @@
2
 wait_response({ data, Data }, #state{ current_command = #command{ response_type = ResponseType, parse_state = CommandState , tag = Tag } } = State) ->
3
     Response = eimap_command:parse_response(ResponseType, Data, Tag, CommandState),
4
     %%lager:info("Response from parser was ~p ~p, size of queue ~p", [More, Response, queue:len(State#state.command_queue)]),
5
+    % FIXME
6
+    % Because several commands can be in flight at the same time, it can happen that we have something like:
7
+    % * Client send: CMD1, CMD2 (triggering a request for metadata)
8
+    % * Because we immediately after processing CMD2 from the client request metadata and start waiting for the response,
9
+    % a response that actually still belongs to CMD1 will not be recognized as such (will end up in here).
10
+    %
11
+    % Below is a workaround for that case; If we fail to parse the repsonse we simply assume it's none of our business and pass it trough.
12
+    %
13
+    % For a proper fix more work would be required, here are some ideas:
14
+    % * Track pending tags and only start associating with this command once we have all outstanding tags completed. The problem is that we don't know about pending tags because normally we don't look for them while passing through.
15
+    % * Buffer data and watch out for any tag. If its not ours pass the data through (would result in performance penalty only while waiting for the command).
16
+    case Response of
17
+        {more,{<<>>,[],_}} -> passthrough({data, Data}, State);
18
+        _ -> {}
19
+    end,
20
     NewState = cancel_timeout(State),
21
     next_command_after_response(Response, NewState);
22
 wait_response(process_command_queue, State) ->
23
@@ -404,7 +419,7 @@
24
 create_socket(Host, Port, _, _Receiver, _ResponseToken, CommandQueue) ->
25
     { gen_tcp:connect(Host, Port, socket_options(), ?TCP_CONNECT_TIMEOUT), false, self(), CommandQueue }.
26
 
27
-socket_options() -> [binary, { active, once }, { send_timeout, 5000 }].
28
+socket_options() -> [binary, { active, once }, { send_timeout, 5000 }, { keepalive, true }].
29
 
30
 upgrade_socket(#state{ socket = Socket, tls_state = true, current_command = Command }) ->
31
     notify_of_response(starttls_complete, Command),
32
@@ -478,13 +493,10 @@
33
     State#state { command_queue = queue:in_r(Command, State#state.command_queue) }.
34
 
35
 inflated(Data, #state{ inflator = undefined }) -> Data;
36
-inflated(Data, #state{ inflator = Inflator }) ->  joined(zlib:inflate(Inflator, Data), <<>>).
37
+inflated(Data, #state{ inflator = Inflator }) ->  iolist_to_binary(zlib:inflate(Inflator, Data)).
38
 
39
 deflated(Data, #state{ deflator = undefined }) -> Data;
40
-deflated(Data, #state{ deflator = Deflator }) ->  joined(zlib:deflate(Deflator, Data, sync), <<>>).
41
-
42
-joined([], Binary) -> Binary;
43
-joined([H|Rest], Binary) -> joined(Rest, <<Binary/binary, H/binary>>).
44
+deflated(Data, #state{ deflator = Deflator }) ->  iolist_to_binary(zlib:deflate(Deflator, Data, sync)).
45
 
46
 reset_timeout(#state{ command_timeout = Timeout } = State) ->
47
     cancel_timeout(State),
48
erlang-eimap-0.4.0.tar.gz/src/eimap_utils.erl -> erlang-eimap-0.4.2.tar.gz/src/eimap_utils.erl Changed
28
 
1
@@ -156,14 +156,20 @@
2
 %% Private
3
 split_command(<<>>) -> { <<>>, <<>>, <<>> };
4
 split_command(Buffer) ->
5
-    End = eol_found(Buffer, binary:match(Buffer, <<"\r\n">>)),
6
+    {Terminated, End} = eol_found(Buffer, binary:match(Buffer, <<"\r\n">>)),
7
     { Tag, CommandStart } = searched_in_buffer(Buffer, 0, End, binary:match(Buffer, <<" ">>, [ { scope, { 0, End } } ])),
8
-    { Command, DataStart } = searched_in_buffer(Buffer, CommandStart, End, binary:match(Buffer, <<" ">>, [ { scope, { CommandStart, End - CommandStart  } } ])),
9
-    Data = binary:part(Buffer, DataStart, End - (DataStart)),
10
-    { Tag, Command, Data }.
11
+    case Terminated of
12
+         true when End == CommandStart ->
13
+            %% when we have a newline, and the tag takes the entire line, the "tag" is actually the command
14
+            {<<>>, Tag, <<>>};
15
+         _ ->
16
+            { Command, DataStart } = searched_in_buffer(Buffer, CommandStart, End, binary:match(Buffer, <<" ">>, [ { scope, { CommandStart, End - CommandStart  } } ])),
17
+            Data = binary:part(Buffer, DataStart, End - (DataStart)),
18
+            { Tag, Command, Data }
19
+    end.
20
 
21
-eol_found(Buffer, nomatch) -> size(Buffer);
22
-eol_found(_Buffer, { MatchStart, _MatchLength }) -> MatchStart.
23
+eol_found(Buffer, nomatch) -> {false, size(Buffer)};
24
+eol_found(_Buffer, { MatchStart, _MatchLength }) -> {true, MatchStart}.
25
 
26
 searched_in_buffer(Buffer, Start, End, nomatch) -> { binary:part(Buffer, Start, End - Start), End };
27
 searched_in_buffer(Buffer, Start, _End, { MatchStart, MatchLength } ) -> { binary:part(Buffer, Start, MatchStart - Start), MatchStart + MatchLength }.
28
erlang-eimap-0.4.0.tar.gz/test/eimap_utils_tests.erl -> erlang-eimap-0.4.2.tar.gz/test/eimap_utils_tests.erl Changed
9
 
1
@@ -79,6 +79,7 @@
2
     Data =
3
     [
4
         { { <<>>, <<>>, <<>> }, <<>> },
5
+        { { <<>>, <<"DONE">>, <<>> }, <<"DONE\r\n">> },
6
         { { <<".">>, <<"LIST">>, <<"\"\" \"*\"">> }, <<". LIST \"\" \"*\"">> },
7
         { { <<"1">>, <<"STARTTLS">>, <<>> }, <<"1 STARTTLS">> },
8
         { { <<"1">>, <<"STARTTLS">>, <<>> }, <<"1 STARTTLS\r\n">> },
9
erlang-eimap.dsc Changed
17
 
1
@@ -2,7 +2,7 @@
2
 Source: erlang-eimap
3
 Binary: erlang-eimap
4
 Architecture: any
5
-Version: 0.4.0-1.1
6
+Version: 0.4.2-1.1
7
 Maintainer: Christoph Erhardt <kolab@sicherha.de>
8
 Homepage: https://git.kolab.org/diffusion/EI/eimap.git
9
 Standards-Version: 3.9.6
10
@@ -10,5 +10,5 @@
11
 Package-List:
12
  erlang-eimap deb devel extra
13
 Files:
14
- 00000000000000000000000000000000 0 erlang-eimap-0.4.0.tar.gz
15
+ 00000000000000000000000000000000 0 erlang-eimap-0.4.2.tar.gz
16
  00000000000000000000000000000000 0 debian.tar.gz
17
Refresh
Refresh


Request History
Jeroen van Meeuwen's avatar

vanmeeuwen created request almost 5 years ago

Check in 0.4.2


Jeroen van Meeuwen's avatar

vanmeeuwen accepted review almost 5 years ago

Accept


Jeroen van Meeuwen's avatar

vanmeeuwen accepted review almost 5 years ago

Accept


Jeroen van Meeuwen's avatar

vanmeeuwen approved review almost 5 years ago

Accept


Jeroen van Meeuwen's avatar

vanmeeuwen accepted request almost 5 years ago

Accept