aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_peer.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2015-03-24 11:01:36 +0100
committerAnders Svensson <[email protected]>2015-03-24 11:01:36 +0100
commitb7d8668ea5a4215da900bfcd2a1dbd51384cb0c7 (patch)
tree4b9900e8668867cfb94dce4d187b560828ab9134 /lib/diameter/src/base/diameter_peer.erl
parentbcecea772faea599ffd56776b1177865f08ca7b5 (diff)
parent949cec3fdcf94310aa567921ac2ea37569beb970 (diff)
downloadotp-b7d8668ea5a4215da900bfcd2a1dbd51384cb0c7.tar.gz
otp-b7d8668ea5a4215da900bfcd2a1dbd51384cb0c7.tar.bz2
otp-b7d8668ea5a4215da900bfcd2a1dbd51384cb0c7.zip
Merge branch 'anders/diameter/string_decode/OTP-11952' into maint
* anders/diameter/string_decode/OTP-11952: Let examples override default service options Set {restrict_connections, false} in example server Set {string_decode, false} in examples Test {string_decode, false} in traffic suite Add service_opt() string_decode Strip potentially large terms when sending outgoing Diameter messages Improve language consistency in diameter(1)
Diffstat (limited to 'lib/diameter/src/base/diameter_peer.erl')
-rw-r--r--lib/diameter/src/base/diameter_peer.erl21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/diameter/src/base/diameter_peer.erl b/lib/diameter/src/base/diameter_peer.erl
index ea326dd03e..89b63c8a92 100644
--- a/lib/diameter/src/base/diameter_peer.erl
+++ b/lib/diameter/src/base/diameter_peer.erl
@@ -232,12 +232,22 @@ recv(Pid, Pkt) ->
%% # send/2
%% ---------------------------------------------------------------------------
-send(Pid, #diameter_packet{transport_data = undefined,
- bin = Bin}) ->
- send(Pid, Bin);
+send(Pid, Msg) ->
+ ifc_send(Pid, {send, strip(Msg)}).
-send(Pid, Pkt) ->
- ifc_send(Pid, {send, Pkt}).
+%% Send only binary when possible.
+strip(#diameter_packet{transport_data = undefined,
+ bin = Bin}) ->
+ Bin;
+
+%% Strip potentially large message terms.
+strip(#diameter_packet{transport_data = T,
+ bin = Bin}) ->
+ #diameter_packet{transport_data = T,
+ bin = Bin};
+
+strip(Msg) ->
+ Msg.
%% ---------------------------------------------------------------------------
%% # close/1
@@ -326,7 +336,6 @@ code_change(_OldVsn, State, _Extra) ->
{ok, State}.
%% ---------------------------------------------------------
-%% INTERNAL FUNCTIONS
%% ---------------------------------------------------------
%% ifc_send/2