From 26900262f3d0a4aabb2e1962cc23bf9a588cfd97 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 18 Mar 2017 22:43:30 +0900 Subject: [PATCH] Revert "nghttpx: Attempt to avoid TCP RST on socket closure on Linux" This reverts commit f69b52b1aa5b196da5104c5dfac81e2de1eb5e53. --- src/shrpx_connection.cc | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/shrpx_connection.cc b/src/shrpx_connection.cc index a0c9d93a..4a4ed14e 100644 --- a/src/shrpx_connection.cc +++ b/src/shrpx_connection.cc @@ -126,20 +126,7 @@ void Connection::disconnect() { } if (fd != -1) { - // At least for Linux, shutdown both sides, and continue to read - // until it gets EOF or error in order to avoid TCP RST. - shutdown(fd, SHUT_RDWR); -#ifdef __linux__ - std::array b; - for (;;) { - ssize_t n; - while ((n = read(fd, b.data(), b.size())) == -1 && errno == EINTR) - ; - if (n <= 0) { - break; - } - } -#endif // __linux__ + shutdown(fd, SHUT_WR); close(fd); fd = -1; }