diff options
author | Sverker Eriksson <[email protected]> | 2018-11-28 20:31:37 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-11-28 20:32:23 +0100 |
commit | 06c46662022efb6892c036eeaf8c957e51fc17f7 (patch) | |
tree | 592110ed892da08874980e0ce369f1b30f5b7d31 /lib/kernel/test | |
parent | 0ad63bcc5523f0b560c843b3ed02c08e1369e522 (diff) | |
download | otp-06c46662022efb6892c036eeaf8c957e51fc17f7.tar.gz otp-06c46662022efb6892c036eeaf8c957e51fc17f7.tar.bz2 otp-06c46662022efb6892c036eeaf8c957e51fc17f7.zip |
erts: Fix unexpected inet_reply message from failing file:sendfile
A failing file:sendfile call would often send a message
{inet_reply, Port, {error, Reason}} that would pollute the mailbox
of the calling process.
TCP_REQ_SENDFILE has its own reply messages format
{sendfile, _, _} and does not expect an inet_reply message.
Solution: Suppress inet_reply error message if TCP_ADDF_SENDFILE
is set.
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/sendfile_SUITE.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/kernel/test/sendfile_SUITE.erl b/lib/kernel/test/sendfile_SUITE.erl index 062209fa29..ad060aa05c 100644 --- a/lib/kernel/test/sendfile_SUITE.erl +++ b/lib/kernel/test/sendfile_SUITE.erl @@ -342,8 +342,20 @@ t_sendfile_closeduring(Config) -> end, ok = sendfile_send({127,0,0,1}, Send, 0, [{active,false}]), - ok = sendfile_send({127,0,0,1}, Send, 0, [{active,true}]). + [] = flush(), + ok = sendfile_send({127,0,0,1}, Send, 0, [{active,true}]), + [] = flush(), + ok. + +flush() -> + lists:reverse(flush([])). +flush(Acc) -> + receive M -> + flush([M | Acc]) + after 0 -> + Acc + end. t_sendfile_crashduring(Config) -> Filename = proplists:get_value(big_file, Config), |