aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-07-19 14:36:34 +0200
committerMicael Karlberg <[email protected]>2018-09-18 14:50:18 +0200
commitf0a2e68a31ac585780ad05f777f1b7551770420e (patch)
treea45d1a46e617e7d71142b3ce5e87504ca33c3515 /lib
parentd28129b7098bce154264937862fcdafb21541433 (diff)
downloadotp-f0a2e68a31ac585780ad05f777f1b7551770420e.tar.gz
otp-f0a2e68a31ac585780ad05f777f1b7551770420e.tar.bz2
otp-f0a2e68a31ac585780ad05f777f1b7551770420e.zip
[socket-nif] Add support for socket (level sctp) option disable_fragments
Added support for the SCTP option DISABLE_FRAGMENTS. OTP-14831
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/test/socket_server.erl27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/kernel/test/socket_server.erl b/lib/kernel/test/socket_server.erl
index 23f30a0d03..a9b4aca5f8 100644
--- a/lib/kernel/test/socket_server.erl
+++ b/lib/kernel/test/socket_server.erl
@@ -187,14 +187,21 @@ do_manager_init(Domain, seqpacket = Type, sctp = Proto, _Peek) ->
{ok, Sock} ->
i("(sctp) socket opened: "
"~n ~p", [Sock]),
- F = fun(_Desc, Expect, Expect) ->
- Expect;
- (Desc, Expect, Actual) ->
- e("Unexpected result ~w: "
- "~n Expect: ~p"
- "~n Actual: ~p", [Desc, Expect, Actual]),
- exit({Desc, Expect, Actual})
- end,
+ EXP = fun(_Desc, Expect, Expect) ->
+ Expect;
+ (Desc, Expect, Actual) ->
+ e("Unexpected result ~w: "
+ "~n Expect: ~p"
+ "~n Actual: ~p", [Desc, Expect, Actual]),
+ exit({Desc, Expect, Actual})
+ end,
+ GO = fun(O) -> case socket:getopt(Sock, sctp, O) of
+ {ok, V} -> f("~p", [V]);
+ {error, R} -> f("error: ~p", [R])
+ end
+ end,
+ i("Miscellaneous options: "
+ "~n disable-fragments: ~s", [GO(disable_fragments)]),
Events = #{data_in => true,
association => true,
address => true,
@@ -205,8 +212,8 @@ do_manager_init(Domain, seqpacket = Type, sctp = Proto, _Peek) ->
adaptation_layer => true,
authentication => true,
sender_dry => true},
- F(set_sctp_events, ok, socket:setopt(Sock, sctp, events, Events)),
- F(close_socket, ok, socket:close(Sock));
+ EXP(set_sctp_events, ok, socket:setopt(Sock, sctp, events, Events)),
+ EXP(close_socket, ok, socket:close(Sock));
{error, Reason} ->
exit({failed_open, Reason})
end.