From 501b27d75cdf9623756848fc09cf16e59fe523ce Mon Sep 17 00:00:00 2001
From: Anders Svensson
Date: Tue, 22 Aug 2017 14:45:39 +0200
Subject: Rename transport_opt() capx_strictness to strict_capx
To follow the naming of options like strict_mbit and more. Still accept
capx_strictness since this is known to be used.
Introduced in commit e4f28f3b.
---
lib/diameter/src/base/diameter.erl | 2 +-
lib/diameter/src/base/diameter_config.erl | 2 ++
lib/diameter/src/base/diameter_peer_fsm.erl | 4 ++--
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/diameter/src/base/diameter.erl b/lib/diameter/src/base/diameter.erl
index 2e18a1d903..888a108f8b 100644
--- a/lib/diameter/src/base/diameter.erl
+++ b/lib/diameter/src/base/diameter.erl
@@ -394,7 +394,7 @@ call(SvcName, App, Message) ->
| {capabilities, [capability()]}
| {capabilities_cb, evaluable()}
| {capx_timeout, 'Unsigned32'()}
- | {capx_strictness, boolean()}
+ | {strict_capx, boolean()}
| {disconnect_cb, evaluable()}
| {dpr_timeout, 'Unsigned32'()}
| {dpa_timeout, 'Unsigned32'()}
diff --git a/lib/diameter/src/base/diameter_config.erl b/lib/diameter/src/base/diameter_config.erl
index f1b6e56782..d54dbd9976 100644
--- a/lib/diameter/src/base/diameter_config.erl
+++ b/lib/diameter/src/base/diameter_config.erl
@@ -591,6 +591,8 @@ opt({K, Tmo})
?IS_UINT32(Tmo);
opt({capx_strictness, B}) ->
+ is_boolean(B) andalso {value, {strict_capx, B}};
+opt({strict_capx, B}) ->
is_boolean(B);
opt({length_errors, T}) ->
diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl
index 4870b86be5..77ee3d6057 100644
--- a/lib/diameter/src/base/diameter_peer_fsm.erl
+++ b/lib/diameter/src/base/diameter_peer_fsm.erl
@@ -239,7 +239,7 @@ i({Ack, WPid, {M, Ref} = T, Opts, {SvcOpts, Nodes, Dict0, Svc}}) ->
proplists:get_value(dpa_timeout, Opts, ?DPA_TIMEOUT)}),
Tmo = proplists:get_value(capx_timeout, Opts, ?CAPX_TIMEOUT),
- Strictness = proplists:get_value(capx_strictness, Opts, true),
+ Strict = proplists:get_value(strict_capx, Opts, true),
LengthErr = proplists:get_value(length_errors, Opts, exit),
{TPid, Addrs} = start_transport(T, Rest, Svc),
@@ -253,7 +253,7 @@ i({Ack, WPid, {M, Ref} = T, Opts, {SvcOpts, Nodes, Dict0, Svc}}) ->
mode = M,
service = svc(Svc, Addrs),
length_errors = LengthErr,
- strict = Strictness,
+ strict = Strict,
incoming_maxlen = Maxlen,
codec = maps:with([decode_format,
string_decode,
--
cgit v1.2.3
From 3c7e35ca4512088f0b4074f809f3110dfa285b8e Mon Sep 17 00:00:00 2001
From: Anders Svensson
Date: Tue, 22 Aug 2017 15:37:04 +0200
Subject: Document transport_opt() strict_capx
---
lib/diameter/doc/src/diameter.xml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml
index 3ad24257a5..264dbf9152 100644
--- a/lib/diameter/doc/src/diameter.xml
+++ b/lib/diameter/doc/src/diameter.xml
@@ -1409,6 +1409,20 @@ Options monitor and link are ignored.
Defaults to the list configured on the service if not specified.
+
+{strict_capx, boolean()]}
+-
+
+Whether or not to enforce the RFC 6733 requirement that any message
+before capabilities exchange should close the peer connection.
+If false then unexpected messages are discarded.
+
+
+Defaults to true.
+Changing this results in non-standard behaviour, but can be useful in
+case peers are known to be behave badly.
+
+
{transport_config, term()}
{transport_config, term(), &dict_Unsigned32; | infinity}
--
cgit v1.2.3