Skip to content

Commit ed4ec1d

Browse files
Merge pull request #4363 from esl/rename_c2s_state_timeout
Rename `c2s_state_timeout` option to `state_timeout`
2 parents 3f2f4f8 + 2337813 commit ed4ec1d

File tree

9 files changed

+16
-12
lines changed

9 files changed

+16
-12
lines changed

doc/listeners/listen-c2s.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ The value of the access rule needs to be either the shaper name or the string `"
3030

3131
Maximum number of open connections. This is a *soft limit* according to the [Ranch](https://ninenines.eu/docs/en/ranch/2.1/manual/ranch) documentation.
3232

33-
### `listen.c2s.c2s_state_timeout`
33+
### `listen.c2s.state_timeout`
3434
* **Syntax:** non-negative integer or the string `"infinity"`
3535
* **Default:** `5000`
36-
* **Example:** `c2s_state_timeout = 10_000`
36+
* **Example:** `state_timeout = 10_000`
3737

3838
Timeout value (in milliseconds) used by the C2S state machine when waiting for the connecting client to respond during stream negotiation and SASL authentication. After the timeout the server responds with the `connection-timeout` stream error and closes the connection.
3939

doc/listeners/listen-http.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ Maximum allowed incoming stanza size in bytes.
8383

8484
### `listen.http.handlers.mod_websockets.c2s_state_timeout`
8585

86-
Same as the [C2S option](listen-c2s.md#listenc2sc2s_state_timeout)
86+
Same as the [C2S option](listen-c2s.md#listenc2sstate_timeout).
8787

8888
### `listen.http.handlers.mod_websockets.backwards_compatible_session`
8989

90-
Same as the [C2S option](listen-c2s.md#listenc2sbackwards_compatible_session)
90+
Same as the [C2S option](listen-c2s.md#listenc2sbackwards_compatible_session).
9191

9292
## Handler types: GraphQL API - `mongoose_graphql_handler`
9393

doc/migrations/6.0.0_6.1.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ With the new implementation of the client-to-server (C2S) state machine, `mongoo
66
* Support for [`listen.http.handlers.mod_websockets.service`] has been removed, the component connection over WebSockets did not correspond to any XEP/RFC, and neither it was properly described anywhere in the MIM documentation. It was present in the default configuration file, and **you need to delete it** from your listener configuration unless you have already done so.
77
* The `max_fsm_queue` option is no longer supported for C2S listeners. It is incompatible with the new `gen_statem` state machine, and if you need to limit incoming traffic, you should use [traffic shapers](../../configuration/shaper) instead. You need to remove this option from your C2S configuration if you are using it.
88
* The default value of the [`backlog`](../configuration/listen.md#listenbacklog) option for all XMPP listeners has been increased from 100 to 1024 for performance reasons.
9-
* You might be interested in the new C2S listener options: [`max_connections`](../listeners/listen-c2s.md#listenc2smax_connections), [`c2s_state_timeout`](../listeners/listen-c2s.md#listenc2sc2s_state_timeout), [`reuse_port`](../listeners/listen-c2s.md#listenc2sreuse_port) and [`backwards_compatible_session`](../listeners/listen-c2s.md#listenc2sbackwards_compatible_session). The first two options can be set for [websockets](../listeners/listen-http.md#handler-types-websockets-mod_websockets) as well.
9+
* You might be interested in the new C2S listener options: [`max_connections`](../listeners/listen-c2s.md#listenc2smax_connections), [`c2s_state_timeout`](../listeners/listen-c2s.md#listenc2sstate_timeout), [`reuse_port`](../listeners/listen-c2s.md#listenc2sreuse_port) and [`backwards_compatible_session`](../listeners/listen-c2s.md#listenc2sbackwards_compatible_session). The first two options can be set for [websockets](../listeners/listen-http.md#handler-types-websockets-mod_websockets) as well.
1010

1111
## Module configuration
1212

doc/migrations/6.2.1_x.x.x.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22

33
Hook names have been unified by removing the `_hook` prefix from the few hooks which used it,
44
e.g. `offline_message_hook` is now called `offline_message`. This change affects the hook metric names as well.
5+
6+
## Listener configuration
7+
8+
`listen.c2s.c2s_state_timeout` option has been renamed to [listen.c2s.state_timeout](../listeners/listen-c2s.md#listenc2sstate_timeout).

src/c2s/mongoose_c2s.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
-type listener_opts() :: #{shaper := atom(),
6363
max_stanza_size := non_neg_integer(),
6464
backwards_compatible_session := boolean(),
65-
c2s_state_timeout := non_neg_integer(),
65+
state_timeout := non_neg_integer(),
6666
port := inet:port_number(),
6767
ip_tuple := inet:ip_address(),
6868
proto := tcp,
@@ -1027,7 +1027,7 @@ send_xml(#c2s_data{socket = Socket}, XmlElements) when is_list(XmlElements) ->
10271027

10281028
state_timeout(#c2s_data{listener_opts = LOpts}) ->
10291029
state_timeout(LOpts);
1030-
state_timeout(#{c2s_state_timeout := Timeout}) ->
1030+
state_timeout(#{state_timeout := Timeout}) ->
10311031
{state_timeout, Timeout, state_timeout_termination}.
10321032

10331033
-spec replace_resource(data(), binary()) -> data().

src/config/mongoose_config_spec.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ xmpp_listener_extra(<<"c2s">>) ->
301301
validate = non_empty},
302302
<<"max_connections">> => #option{type = int_or_infinity,
303303
validate = positive},
304-
<<"c2s_state_timeout">> => #option{type = int_or_infinity,
304+
<<"state_timeout">> => #option{type = int_or_infinity,
305305
validate = non_negative},
306306
<<"reuse_port">> => #option{type = boolean},
307307
<<"backwards_compatible_session">> => #option{type = boolean},
@@ -313,7 +313,7 @@ xmpp_listener_extra(<<"c2s">>) ->
313313
defaults = #{<<"access">> => all,
314314
<<"shaper">> => none,
315315
<<"max_connections">> => infinity,
316-
<<"c2s_state_timeout">> => 5000,
316+
<<"state_timeout">> => 5000,
317317
<<"reuse_port">> => false,
318318
<<"backwards_compatible_session">> => true}
319319
};

src/mod_bosh_socket.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ init([{HostType, Sid, Peer, PeerCert, ListenerOpts}]) ->
202202
xml_socket => true,
203203
max_stanza_size => 0,
204204
hibernate_after => 0,
205-
c2s_state_timeout => 5000,
205+
state_timeout => 5000,
206206
backwards_compatible_session => true,
207207
proto => tcp},
208208
{ok, C2SPid} = mongoose_c2s:start({?MODULE, BoshSocket, C2SOpts}, []),

src/mod_websockets.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ maybe_start_fsm([#xmlel{ name = <<"open">> }],
211211
max_stanza_size => 0,
212212
xml_socket => true,
213213
hibernate_after => 0,
214-
c2s_state_timeout => StateTimeout,
214+
state_timeout => StateTimeout,
215215
backwards_compatible_session => BackwardsCompatible,
216216
port => Port, ip_tuple => IPTuple, proto => tcp},
217217
do_start_fsm(Opts, State);

test/common/config_parser_helper.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ default_config([listen, http, tls]) ->
11281128
default_config([listen, c2s]) ->
11291129
(common_xmpp_listener_config())#{module => mongoose_c2s_listener,
11301130
max_connections => infinity,
1131-
c2s_state_timeout => 5000,
1131+
state_timeout => 5000,
11321132
reuse_port => false,
11331133
backwards_compatible_session => true,
11341134
access => all,

0 commit comments

Comments
 (0)