aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-03-29 15:41:57 +0200
committerLukas Larsson <[email protected]>2018-03-29 15:41:57 +0200
commitf99860259ee557851acc865519a315f04d1d4d51 (patch)
tree848154651b2a9987cddb6621c9f0934670979456
parent2a700f64628bb16c4489ae89259c7871ced598e1 (diff)
parent553896346c987d27958adc392940a3a197bbcdc4 (diff)
downloadotp-f99860259ee557851acc865519a315f04d1d4d51.tar.gz
otp-f99860259ee557851acc865519a315f04d1d4d51.tar.bz2
otp-f99860259ee557851acc865519a315f04d1d4d51.zip
Merge branch 'lukas/erts/tcp_send_return_closed/OTP-15001'
* lukas/erts/tcp_send_return_closed/OTP-15001: erts: tcp send should return {error,closed}
-rw-r--r--erts/emulator/drivers/common/inet_drv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 4294fb4f46..1a68f65b52 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -9930,6 +9930,12 @@ static int tcp_recv_closed(tcp_descriptor* desc)
set_busy_port(desc->inet.port, 0);
inet_reply_error_am(INETP(desc), am_closed);
DEBUGF(("tcp_recv_closed(%ld): busy reply 'closed'\r\n", port));
+ } else {
+ /* No blocking send op to reply to right now.
+ * If next op is a send, make sure it returns {error,closed}
+ * rather than {error,enotconn}.
+ */
+ desc->tcp_add_flags |= TCP_ADDF_DELAYED_CLOSE_SEND;
}
if (!desc->inet.active) {
/* We must cancel any timer here ! */