aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2017-06-27 15:52:56 +0200
committerJohn Högberg <[email protected]>2017-06-27 15:52:56 +0200
commit0dced656e6871e03a153bb99af10d8710ffca7d9 (patch)
tree6fee44d1d76d0b96a4c6f4e7bd104b69b60b316f /erts/emulator/drivers
parent798924ffd5efff77ba94ea7f54c2e69548d9d07e (diff)
parent8d9cde83b628533ae7a5fe85a5dd9c6c00c084e3 (diff)
downloadotp-0dced656e6871e03a153bb99af10d8710ffca7d9.tar.gz
otp-0dced656e6871e03a153bb99af10d8710ffca7d9.tar.bz2
otp-0dced656e6871e03a153bb99af10d8710ffca7d9.zip
Merge branch 'maint-19' into maint
* maint-19: Updated OTP version Update release notes Update version numbers Fix statistics(wall_clock) and statistics(runtime) implementation fixup! erts: Cleanup dropped port tasks correctly erts: Add tests to detect port close race Add a testcase for OTP-13939/ERL-193 erts: Cleanup dropped port tasks correctly Mark socket disconnected on tcp_send_or_shutdown_error
Diffstat (limited to 'erts/emulator/drivers')
-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 13ee935e45..fe421bfe12 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -4334,6 +4334,12 @@ static void desc_close(inet_descriptor* desc)
desc->event = INVALID_EVENT; /* closed by stop_select callback */
desc->s = INVALID_SOCKET;
desc->event_mask = 0;
+
+ /* mark as disconnected in case when socket is left lingering due to
+ * {exit_on_close, false} option in gen_tcp socket creation. Next
+ * write to socket should produce {error, enotconn} and send a
+ * message {tcp_error,#Port<>,econnreset} */
+ desc->state &= ~INET_STATE_CONNECTED;
}
}