Bläddra i källkod

Call shutdown() with SHUT_WR before close to avoid TCP RST.

Tatsuhiro Tsujikawa 14 år sedan
förälder
incheckning
6f602e2809
1 ändrade filer med 1 tillägg och 0 borttagningar
  1. 1 0
      src/SocketCore.cc

+ 1 - 0
src/SocketCore.cc

@@ -566,6 +566,7 @@ void SocketCore::closeConnection()
   }
   }
 #endif // HAVE_LIBGNUTLS
 #endif // HAVE_LIBGNUTLS
   if(sockfd_ != (sock_t) -1) {
   if(sockfd_ != (sock_t) -1) {
+    shutdown(sockfd_, SHUT_WR);
     CLOSE(sockfd_);
     CLOSE(sockfd_);
     sockfd_ = -1;
     sockfd_ = -1;
   }
   }