aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2016-03-17 14:50:53 +0100
committerAnders Svensson <[email protected]>2016-03-18 09:28:59 +0100
commit14eb86d85c5f191d78013aaa45b7e1aabf04a937 (patch)
tree7aeeb8354f37fe67c55c088a76c002ff3ac604d7
parentc322099e7e7efeb01577e4c8efd52579beb90949 (diff)
downloadotp-14eb86d85c5f191d78013aaa45b7e1aabf04a937.tar.gz
otp-14eb86d85c5f191d78013aaa45b7e1aabf04a937.tar.bz2
otp-14eb86d85c5f191d78013aaa45b7e1aabf04a937.zip
Let throttling callback send a throttle message
That is, don't assume that it's only diameter_tcp doing so: allow it to be received when not throttling. This lets a callback module trigger a new throttling callback itself, but it's not clear if this will be useful in practice.
-rw-r--r--lib/diameter/src/transport/diameter_tcp.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/diameter/src/transport/diameter_tcp.erl b/lib/diameter/src/transport/diameter_tcp.erl
index 01f5bb8e66..1622e1b3d4 100644
--- a/lib/diameter/src/transport/diameter_tcp.erl
+++ b/lib/diameter/src/transport/diameter_tcp.erl
@@ -555,8 +555,9 @@ transition({P, Sock, Bin}, #transport{socket = Sock,
recv(Bin, S);
%% Make a new throttling callback after a timeout.
-transition(throttle, #transport{throttled = B} = S) ->
- true = false /= B, %% assert
+transition(throttle, #transport{throttled = false}) ->
+ ok;
+transition(throttle, S) ->
throttle(S);
%% Capabilties exchange has decided on whether or not to run over TLS.