Projects
Kolab:Winterfell
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
@@ -6,7 +6,7 @@ %global debug_package %{nil} Name: erlang-%{realname} -Version: 0.2.2 +Version: 0.2.4 Release: 0.20160111.git%{?dist} Summary: Erlang IMAP client Group: Development/Libraries @@ -15,8 +15,7 @@ %if 0%{?el7}%{?fedora} VCS: scm:git:https://git.kolab.org/diffusion/EI/%{realname}.git %endif -Source0: erlang-eimap-0.2.2.tar.gz -Patch0001: eimap-0.2.2-relax-deps.patch +Source0: erlang-eimap-0.2.4.tar.gz BuildRequires: erlang-goldrush >= 0.1.7 BuildRequires: erlang-lager >= 2.2.0 @@ -57,6 +56,8 @@ %{_libdir}/erlang/lib/%{realname}-%{version}/ebin/*.beam %changelog +* Wed Jun 08 2016 Aaron Seigo <seigo@kolabsystems.com> - 0.2.4-1 +- Packaging of 0.2.4 * Tue Jun 07 2016 Aaron Seigo <seigo@kolabsystems.com> - 0.2.2-1 - Packaging of 0.2.2 * Mon Dec 21 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.1.2-1
View file
eimap-0.2.2-relax-deps.patch
Deleted
@@ -1,12 +0,0 @@ -diff -ur eimap-0.2.2.orig/rebar.config eimap-0.2.2/rebar.config ---- eimap-0.2.2.orig/rebar.config 2016-06-07 10:09:20.000000000 +0200 -+++ eimap-0.2.2/rebar.config 2016-06-08 10:45:53.822031539 +0200 -@@ -2,7 +2,7 @@ - %% ex: ft=erlang ts=4 sw=4 et - - {deps, [ -- { lager, "(2.0|2.1|2.2).*", { git, "git://github.com/basho/lager.git", { tag, "2.2.0" } } } -+ { lager, ".*", { git, "git://github.com/basho/lager.git" } } - ]}. - - {erl_opts, [warnings_as_errors, {parse_transform, lager_transform}]}.
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +erlang-eimap (0.2.4) unstable; urgency=medium + + * Package the 0.2.4 release + + -- Aaron Seigo <seigo@kolabsystems.com> Wed, 08 Jun 2016 10:30:50 +0100 + erlang-eimap (0.2.2) unstable; urgency=medium * Package the 0.2.2 release
View file
debian.tar.gz/rebar.config
Changed
@@ -2,7 +2,7 @@ %% ex: ft=erlang ts=4 sw=4 et {deps, [ - { lager, "(2.0|2.1|2.2).*", { git, "git://github.com/basho/lager.git", { tag, "2.2.0" } } } + { lager, ".*", { git, "git://github.com/basho/lager.git" } } ]}. {erl_opts, [warnings_as_errors, {parse_transform, lager_transform}]}.
View file
debian.tar.gz/src/eimap.app.src
Changed
@@ -2,7 +2,7 @@ {application, eimap, [ { description, "IMAP client implementation" }, - { vsn, "0.2.2" }, + { vsn, "0.2.4" }, { registered, [] }, { applications, [ kernel,
View file
debian.tar.gz/src/eimap.erl
Changed
@@ -49,7 +49,7 @@ command_serial = 1, command_queue = queue:new(), current_command, current_mbox, passthrough = false, passthrough_recv, passthrough_send_buffer = <<>>, - inflator, deflator}). + inflator, deflator, process_command_queue_guard = false }). -record(command, { tag, mbox, message, from, response_type, response_token, parse_state }). -define(SSL_UPGRADE_TIMEOUT, 5000). @@ -159,19 +159,19 @@ Receiver ! { imap_server_response, Data }, { next_state, passthrough, State }; passthrough(Command, State) when is_record(Command, command) -> - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, enque_command(Command, State) }. + NewState = ensure_process_command_queue(State), + { next_state, idle, enque_command(Command, NewState) }. idle(process_command_queue, #state{ command_queue = Queue } = State) -> + UnguardedState = State#state{ process_command_queue_guard = false }, case queue:out(Queue) of { { value, Command }, ModifiedQueue } when is_record(Command, command) -> %lager:info("Clearing queue of ~p", [Command]), - NewState = send_command(Command, State#state{ command_queue = ModifiedQueue }), + NewState = send_command(Command, UnguardedState#state{ command_queue = ModifiedQueue }), { next_state, wait_response, NewState }; - { empty, ModifiedQueue } -> + { empty, _ModifiedQueue } -> NextState = next_state_after_emptied_queue(State), - %lager:info("Queue was empty moving on to ... ~p", [NextState]), - { next_state, NextState, State#state{ command_queue = ModifiedQueue } } + { next_state, NextState, UnguardedState } end; idle({ data, _Data }, State) -> %%lager:info("Idling, server sent: ~p", [_Data]), @@ -181,7 +181,8 @@ NewState = send_command(Command, State), { next_state, wait_response, NewState }; idle(_Event, State) -> - { next_state, idle, State }. + { next_state, idle, ensure_process_command_queue(State) }. + next_state_after_emptied_queue(#state{ passthrough = true }) -> gen_fsm:send_event(self(), flush_passthrough_buffer), @@ -189,13 +190,20 @@ next_state_after_emptied_queue(_State) -> idle. +ensure_process_command_queue(State) -> + case State#state.process_command_queue_guard of + true -> + State; + _ -> + gen_fsm:send_event(self(), process_command_queue), + State#state{ process_command_queue_guard = true } + end. %%TODO a variant that checks "#command{ from = undefined }" to avoid parsing responses which will go undelivered? wait_response(Command, State) when is_record(Command, command) -> { next_state, wait_response, enque_command(Command, State) }; wait_response({ data, _Data }, #state{ current_command = #command{ parse_state = undefined } } = State) -> - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State }; + { next_state, idle, ensure_process_command_queue(State) }; wait_response({ data, Data }, #state{ current_command = #command{ response_type = ResponseType, parse_state = CommandState , tag = Tag } } = State) -> Response = eimap_command:parse_response(ResponseType, Data, Tag, CommandState), %%lager:info("Response from parser was ~p ~p, size of queue ~p", [More, Response, queue:len(State#state.command_queue)]), @@ -227,22 +235,21 @@ handle_event({ start_passthrough, Receiver }, StateName, State) -> { next_state, StateName, State#state{ passthrough = true, passthrough_recv = Receiver } }; handle_event(stop_passthrough, StateName, State) -> - NextState = case StateName of - passthrough -> - gen_fsm:send_event(self(), process_command_queue), - idle; - State -> State + { NextStateName, NewState } = case StateName of + passthrough -> { idle, ensure_process_command_queue(State) }; + StateName -> { StateName, State } end, - { next_state, NextState, State#state{ passthrough = false } }; + { next_state, NextStateName, NewState#state{ passthrough = false } }; handle_event({ passthrough, Data }, passthrough, #state{ passthrough = true } = State) -> ?MODULE:passthrough({ passthrough, Data }, State); handle_event({ passthrough, Data }, StateName, #state{ passthrough = true, passthrough_send_buffer = Buffer } = State) -> NewBuffer = <<Buffer/binary, Data/binary>>, + NewState = case StateName of - idle -> gen_fsm:send_event(self(), process_command_queue); - _ -> ok + idle -> ensure_process_command_queue(State); + _ -> State end, - { next_state, StateName, State#state{ passthrough_send_buffer = NewBuffer } }; + { next_state, StateName, NewState#state{ passthrough_send_buffer = NewBuffer } }; handle_event(_Event, StateName, State) -> { next_state, StateName, State}. handle_sync_event(_Event, _From, StateName, State) -> { next_state, StateName, State}. @@ -348,22 +355,22 @@ { next_state, wait_response, State#state{ current_command = State#state.current_command#command{ parse_state = ParseState } } }; next_command_after_response({ error, _ } = ErrorResponse, State) -> notify_of_response(ErrorResponse, State#state.current_command), - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State#state{ current_command = undefined } }; + NewState = ensure_process_command_queue(State), + { next_state, idle, NewState#state{ current_command = undefined } }; next_command_after_response({ fini, Response }, State) -> %lager:info("Notifying with ~p", [State#state.current_command]), notify_of_response(Response, State#state.current_command), - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State#state{ current_command = undefined } }; + NewState = ensure_process_command_queue(State), + { next_state, idle, NewState#state{ current_command = undefined } }; next_command_after_response(starttls, State) -> { TLSState, Socket } = upgrade_socket(State), %lager:info("~p Upgraded the socket ...", [self()]), - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State#state{ current_command = undefined, socket = Socket, tls_state = TLSState } }; + NewState = ensure_process_command_queue(State), + { next_state, idle, NewState#state{ current_command = undefined, socket = Socket, tls_state = TLSState } }; next_command_after_response(compression_active, State) -> { Inflator, Deflator } = eimap_utils:new_imap_compressors(), - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State#state{ current_command = undefined, inflator = Inflator, deflator = Deflator } }; + NewState = ensure_process_command_queue(State), + { next_state, idle, NewState#state{ current_command = undefined, inflator = Inflator, deflator = Deflator } }; next_command_after_response({ close_socket, Response }, State) -> notify_of_response(Response, State#state.current_command), { stop, normal, State }.
View file
debian.tar.gz/src/eimap_command.erl
Changed
@@ -49,7 +49,7 @@ Checked = eimap_utils:check_response_for_failure(Line, Tag), Module:formulate_response(Checked, parse_tagged(Checked, ParseTaggedLine, Line, Acc, Module)); process_line(0, ParseTaggedLine, untagged, Tag, LastPartialLine, Line, MoreLines, Acc, Module) -> - io:format("Calling it here with ~p~n~n...", [Line]), + %io:format("Calling it here with ~p~n~n...", [Line]), process_lines(ParseTaggedLine, Tag, LastPartialLine, MoreLines, Module:process_line(Line, Acc), Module); process_line(ContinuationBytes, ParseTaggedLine, _IsTagged, Tag, LastPartialLine, Line, [], Acc, Module) -> %% the line was continued, but there is no more lines ... so this line is now our last partial line. more must be on its way
View file
erlang-eimap-0.2.2.tar.gz/rebar.config -> erlang-eimap-0.2.4.tar.gz/rebar.config
Changed
@@ -2,7 +2,7 @@ %% ex: ft=erlang ts=4 sw=4 et {deps, [ - { lager, "(2.0|2.1|2.2).*", { git, "git://github.com/basho/lager.git", { tag, "2.2.0" } } } + { lager, ".*", { git, "git://github.com/basho/lager.git" } } ]}. {erl_opts, [warnings_as_errors, {parse_transform, lager_transform}]}.
View file
erlang-eimap-0.2.2.tar.gz/src/eimap.app.src -> erlang-eimap-0.2.4.tar.gz/src/eimap.app.src
Changed
@@ -2,7 +2,7 @@ {application, eimap, [ { description, "IMAP client implementation" }, - { vsn, "0.2.2" }, + { vsn, "0.2.4" }, { registered, [] }, { applications, [ kernel,
View file
erlang-eimap-0.2.2.tar.gz/src/eimap.erl -> erlang-eimap-0.2.4.tar.gz/src/eimap.erl
Changed
@@ -49,7 +49,7 @@ command_serial = 1, command_queue = queue:new(), current_command, current_mbox, passthrough = false, passthrough_recv, passthrough_send_buffer = <<>>, - inflator, deflator}). + inflator, deflator, process_command_queue_guard = false }). -record(command, { tag, mbox, message, from, response_type, response_token, parse_state }). -define(SSL_UPGRADE_TIMEOUT, 5000). @@ -159,19 +159,19 @@ Receiver ! { imap_server_response, Data }, { next_state, passthrough, State }; passthrough(Command, State) when is_record(Command, command) -> - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, enque_command(Command, State) }. + NewState = ensure_process_command_queue(State), + { next_state, idle, enque_command(Command, NewState) }. idle(process_command_queue, #state{ command_queue = Queue } = State) -> + UnguardedState = State#state{ process_command_queue_guard = false }, case queue:out(Queue) of { { value, Command }, ModifiedQueue } when is_record(Command, command) -> %lager:info("Clearing queue of ~p", [Command]), - NewState = send_command(Command, State#state{ command_queue = ModifiedQueue }), + NewState = send_command(Command, UnguardedState#state{ command_queue = ModifiedQueue }), { next_state, wait_response, NewState }; - { empty, ModifiedQueue } -> + { empty, _ModifiedQueue } -> NextState = next_state_after_emptied_queue(State), - %lager:info("Queue was empty moving on to ... ~p", [NextState]), - { next_state, NextState, State#state{ command_queue = ModifiedQueue } } + { next_state, NextState, UnguardedState } end; idle({ data, _Data }, State) -> %%lager:info("Idling, server sent: ~p", [_Data]), @@ -181,7 +181,8 @@ NewState = send_command(Command, State), { next_state, wait_response, NewState }; idle(_Event, State) -> - { next_state, idle, State }. + { next_state, idle, ensure_process_command_queue(State) }. + next_state_after_emptied_queue(#state{ passthrough = true }) -> gen_fsm:send_event(self(), flush_passthrough_buffer), @@ -189,13 +190,20 @@ next_state_after_emptied_queue(_State) -> idle. +ensure_process_command_queue(State) -> + case State#state.process_command_queue_guard of + true -> + State; + _ -> + gen_fsm:send_event(self(), process_command_queue), + State#state{ process_command_queue_guard = true } + end. %%TODO a variant that checks "#command{ from = undefined }" to avoid parsing responses which will go undelivered? wait_response(Command, State) when is_record(Command, command) -> { next_state, wait_response, enque_command(Command, State) }; wait_response({ data, _Data }, #state{ current_command = #command{ parse_state = undefined } } = State) -> - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State }; + { next_state, idle, ensure_process_command_queue(State) }; wait_response({ data, Data }, #state{ current_command = #command{ response_type = ResponseType, parse_state = CommandState , tag = Tag } } = State) -> Response = eimap_command:parse_response(ResponseType, Data, Tag, CommandState), %%lager:info("Response from parser was ~p ~p, size of queue ~p", [More, Response, queue:len(State#state.command_queue)]), @@ -227,22 +235,21 @@ handle_event({ start_passthrough, Receiver }, StateName, State) -> { next_state, StateName, State#state{ passthrough = true, passthrough_recv = Receiver } }; handle_event(stop_passthrough, StateName, State) -> - NextState = case StateName of - passthrough -> - gen_fsm:send_event(self(), process_command_queue), - idle; - State -> State + { NextStateName, NewState } = case StateName of + passthrough -> { idle, ensure_process_command_queue(State) }; + StateName -> { StateName, State } end, - { next_state, NextState, State#state{ passthrough = false } }; + { next_state, NextStateName, NewState#state{ passthrough = false } }; handle_event({ passthrough, Data }, passthrough, #state{ passthrough = true } = State) -> ?MODULE:passthrough({ passthrough, Data }, State); handle_event({ passthrough, Data }, StateName, #state{ passthrough = true, passthrough_send_buffer = Buffer } = State) -> NewBuffer = <<Buffer/binary, Data/binary>>, + NewState = case StateName of - idle -> gen_fsm:send_event(self(), process_command_queue); - _ -> ok + idle -> ensure_process_command_queue(State); + _ -> State end, - { next_state, StateName, State#state{ passthrough_send_buffer = NewBuffer } }; + { next_state, StateName, NewState#state{ passthrough_send_buffer = NewBuffer } }; handle_event(_Event, StateName, State) -> { next_state, StateName, State}. handle_sync_event(_Event, _From, StateName, State) -> { next_state, StateName, State}. @@ -348,22 +355,22 @@ { next_state, wait_response, State#state{ current_command = State#state.current_command#command{ parse_state = ParseState } } }; next_command_after_response({ error, _ } = ErrorResponse, State) -> notify_of_response(ErrorResponse, State#state.current_command), - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State#state{ current_command = undefined } }; + NewState = ensure_process_command_queue(State), + { next_state, idle, NewState#state{ current_command = undefined } }; next_command_after_response({ fini, Response }, State) -> %lager:info("Notifying with ~p", [State#state.current_command]), notify_of_response(Response, State#state.current_command), - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State#state{ current_command = undefined } }; + NewState = ensure_process_command_queue(State), + { next_state, idle, NewState#state{ current_command = undefined } }; next_command_after_response(starttls, State) -> { TLSState, Socket } = upgrade_socket(State), %lager:info("~p Upgraded the socket ...", [self()]), - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State#state{ current_command = undefined, socket = Socket, tls_state = TLSState } }; + NewState = ensure_process_command_queue(State), + { next_state, idle, NewState#state{ current_command = undefined, socket = Socket, tls_state = TLSState } }; next_command_after_response(compression_active, State) -> { Inflator, Deflator } = eimap_utils:new_imap_compressors(), - gen_fsm:send_event(self(), process_command_queue), - { next_state, idle, State#state{ current_command = undefined, inflator = Inflator, deflator = Deflator } }; + NewState = ensure_process_command_queue(State), + { next_state, idle, NewState#state{ current_command = undefined, inflator = Inflator, deflator = Deflator } }; next_command_after_response({ close_socket, Response }, State) -> notify_of_response(Response, State#state.current_command), { stop, normal, State }.
View file
erlang-eimap-0.2.2.tar.gz/src/eimap_command.erl -> erlang-eimap-0.2.4.tar.gz/src/eimap_command.erl
Changed
@@ -49,7 +49,7 @@ Checked = eimap_utils:check_response_for_failure(Line, Tag), Module:formulate_response(Checked, parse_tagged(Checked, ParseTaggedLine, Line, Acc, Module)); process_line(0, ParseTaggedLine, untagged, Tag, LastPartialLine, Line, MoreLines, Acc, Module) -> - io:format("Calling it here with ~p~n~n...", [Line]), + %io:format("Calling it here with ~p~n~n...", [Line]), process_lines(ParseTaggedLine, Tag, LastPartialLine, MoreLines, Module:process_line(Line, Acc), Module); process_line(ContinuationBytes, ParseTaggedLine, _IsTagged, Tag, LastPartialLine, Line, [], Acc, Module) -> %% the line was continued, but there is no more lines ... so this line is now our last partial line. more must be on its way
View file
erlang-eimap.dsc
Changed
@@ -2,7 +2,7 @@ Source: erlang-eimap Binary: erlang-eimap Architecture: any -Version: 0.2.2-1 +Version: 0.2.4-1 Maintainer: Christoph Erhardt <kolab@sicherha.de> Homepage: https://git.kolab.org/diffusion/EI/eimap.git Standards-Version: 3.9.6 @@ -10,5 +10,5 @@ Package-List: erlang-eimap deb devel extra Files: - 00000000000000000000000000000000 0 erlang-eimap-0.2.2.tar.gz + 00000000000000000000000000000000 0 erlang-eimap-0.2.4.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
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
.