Skip to content

Commit

Permalink
Merge pull request #3797 from esl/c2s/quickfixes
Browse files Browse the repository at this point in the history
C2s/quickfixes
  • Loading branch information
Kamil Wąż authored Oct 6, 2022
2 parents 0d487f8 + c1db2f9 commit a50b2b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/configuration/listen.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The options listed below can be set for the `c2s`, `s2s` and `service` listeners

### `listen.*.backlog`
* **Syntax:** positive integer
* **Default:** `100`
* **Default:** `1024`
* **Example:** `backlog = 1000`

Overrides the default TCP backlog value.
Expand Down
6 changes: 3 additions & 3 deletions src/c2s/mongoose_c2s_acc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
%% - `actions': a list of valid `gen_statem:action()' to request the `mongoose_c2s' engine.
%% - `c2s_state': a new state is requested for the state machine.
%% - `c2s_data': a new state data is requested for the state machine.
%% - `stop': an action of type `{info, {stop, Reason}}' is to be triggered.
%% - `stop': an action of type `{cast, {stop, Reason}}' is to be triggered.
%% - `hard_stop': no other request is allowed, the state machine is immediatly triggered to stop.
%% - `socket_send': xml elements to send on the socket to the user.
-module(mongoose_c2s_acc).
Expand Down Expand Up @@ -68,7 +68,7 @@ new() ->
-spec new(params()) -> t().
new(Params = #{stop := Reason}) ->
WithoutStop = maps:remove(stop, Params),
NewAction = [{next_event, info, {stop, Reason}}],
NewAction = [{next_event, cast, {stop, Reason}}],
Fun = fun(Actions) -> [NewAction | Actions] end,
NewParams = maps:update_with(actions, Fun, NewAction, WithoutStop),
new(NewParams);
Expand Down Expand Up @@ -123,7 +123,7 @@ to_c2s_acc(C2SAcc = #{socket_send := Stanzas}, {socket_send, NewStanzas}) when i
to_c2s_acc(C2SAcc = #{socket_send := Stanzas}, {socket_send, Stanza}) ->
C2SAcc#{socket_send := [Stanza | Stanzas]};
to_c2s_acc(C2SAcc = #{actions := Actions}, {stop, Reason}) ->
C2SAcc#{actions := [{next_event, info, {stop, Reason}} | Actions]};
C2SAcc#{actions := [{next_event, cast, {stop, Reason}} | Actions]};
to_c2s_acc(C2SAcc, {Key, NewValue}) ->
#{Key := _OldValue} = C2SAcc,
C2SAcc#{Key := NewValue}.
2 changes: 1 addition & 1 deletion src/mod_presence.erl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ user_send_presence(Acc, #{c2s_data := StateData}, _Extra) ->
user_receive_presence(Acc, #{c2s_data := StateData}, _Extra) ->
case get_mod_state(StateData) of
{error, not_found} ->
{ok, Acc};
{stop, Acc};
Presences ->
handle_user_received_presence(Acc, Presences, mongoose_acc:stanza_type(Acc))
end.
Expand Down

0 comments on commit a50b2b1

Please sign in to comment.