aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-01-27 15:29:58 +0100
committerLukas Larsson <[email protected]>2014-01-27 15:29:58 +0100
commite59682eae1b7c04bfa011f40f202c0ab5a6527cd (patch)
tree7f7fdc873c9954ca5ac9b1c25240483f1effc891 /lib/kernel/test
parent7850ec6f9906eb62b3e33b8b05194944fff569ff (diff)
parent8f8a03ba3556f2c2c70797bedf5d44b360659425 (diff)
downloadotp-e59682eae1b7c04bfa011f40f202c0ab5a6527cd.tar.gz
otp-e59682eae1b7c04bfa011f40f202c0ab5a6527cd.tar.bz2
otp-e59682eae1b7c04bfa011f40f202c0ab5a6527cd.zip
Merge branch 'lukas/erts/sendfile_passive_mode_fix/OTP-11614'
* lukas/erts/sendfile_passive_mode_fix/OTP-11614: erts: fix bug when using passive mode and sendfile
Diffstat (limited to 'lib/kernel/test')
-rw-r--r--lib/kernel/test/sendfile_SUITE.erl20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/kernel/test/sendfile_SUITE.erl b/lib/kernel/test/sendfile_SUITE.erl
index 4cf4c6489d..24884bada5 100644
--- a/lib/kernel/test/sendfile_SUITE.erl
+++ b/lib/kernel/test/sendfile_SUITE.erl
@@ -33,6 +33,7 @@ all() ->
,t_sendfile_offset
,t_sendfile_sendafter
,t_sendfile_recvafter
+ ,t_sendfile_recvafter_remoteclose
,t_sendfile_sendduring
,t_sendfile_recvduring
,t_sendfile_closeduring
@@ -228,6 +229,25 @@ t_sendfile_recvafter(Config) ->
ok = sendfile_send(Send).
+%% This tests specifically for a bug fixed in 17.0
+t_sendfile_recvafter_remoteclose(Config) ->
+ Filename = proplists:get_value(small_file, Config),
+
+ Send = fun(Sock, SFServer) ->
+ {Size, _Data} = sendfile_file_info(Filename),
+ {ok, Size} = file:sendfile(Filename, Sock),
+
+ %% Make sure the remote end has been closed
+ SFServer ! stop,
+ timer:sleep(100),
+
+ %% In the bug this returned {error,ebadf}
+ {error,closed} = gen_tcp:recv(Sock, 1),
+ -1
+ end,
+
+ ok = sendfile_send({127,0,0,1},Send,0).
+
t_sendfile_sendduring(Config) ->
Filename = proplists:get_value(big_file, Config),