diff options
author | Sverker Eriksson <[email protected]> | 2018-11-27 21:16:47 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-11-28 20:32:23 +0100 |
commit | 0ad63bcc5523f0b560c843b3ed02c08e1369e522 (patch) | |
tree | 7fb5b6fc9c4e48e1f8106cc0d1898b6de351103a /lib | |
parent | 9103097e3480b5fa8737205793df56c6288f5733 (diff) | |
download | otp-0ad63bcc5523f0b560c843b3ed02c08e1369e522.tar.gz otp-0ad63bcc5523f0b560c843b3ed02c08e1369e522.tar.bz2 otp-0ad63bcc5523f0b560c843b3ed02c08e1369e522.zip |
erts: Fix bug in sendfile for active socket
driver_select() was called after port had been killed
by tcp_inet_sendfile() calling tcp_send_error().
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kernel/test/sendfile_SUITE.erl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/kernel/test/sendfile_SUITE.erl b/lib/kernel/test/sendfile_SUITE.erl index 0c0b1cbcb6..062209fa29 100644 --- a/lib/kernel/test/sendfile_SUITE.erl +++ b/lib/kernel/test/sendfile_SUITE.erl @@ -341,7 +341,9 @@ t_sendfile_closeduring(Config) -> -1 end, - ok = sendfile_send({127,0,0,1}, Send, 0). + ok = sendfile_send({127,0,0,1}, Send, 0, [{active,false}]), + ok = sendfile_send({127,0,0,1}, Send, 0, [{active,true}]). + t_sendfile_crashduring(Config) -> Filename = proplists:get_value(big_file, Config), @@ -409,12 +411,16 @@ sendfile_send(Send) -> sendfile_send(Host, Send) -> sendfile_send(Host, Send, []). sendfile_send(Host, Send, Orig) -> + sendfile_send(Host, Send, Orig, [{active,false}]). + +sendfile_send(Host, Send, Orig, SockOpts) -> + SFServer = spawn_link(?MODULE, sendfile_server, [self(), Orig]), receive {server, Port} -> - {ok, Sock} = gen_tcp:connect(Host, Port, - [binary,{packet,0}, - {active,false}]), + Opts = [binary,{packet,0}|SockOpts], + io:format("connect with opts = ~p\n", [Opts]), + {ok, Sock} = gen_tcp:connect(Host, Port, Opts), Data = case proplists:get_value(arity,erlang:fun_info(Send)) of 1 -> Send(Sock); |