Also set the keepalive socket option if the socket is
authorwtc%netscape.com
Tue, 07 Sep 1999 23:43:07 +0000
changeset 801 f061853add56ffa92e9608d4dfd78b633b04b170
parent 800 ebb367567467f17fe4d5d286f9350b9c6afa3f1a
child 809 614b6b0915d7a77aaedba058f2b432bf8f04ab9c
push idunknown
push userunknown
push dateunknown
Also set the keepalive socket option if the socket is an IPv6 TCP socket.
pr/src/io/prsocket.c
--- a/pr/src/io/prsocket.c
+++ b/pr/src/io/prsocket.c
@@ -1186,17 +1186,21 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRIn
 		return NULL;
 	}
 	osfd = _PR_MD_SOCKET(domain, type, proto);
 	if (osfd == -1) {
 		return 0;
 	}
 #ifdef HAVE_SOCKET_KEEPALIVE
 	/* "Keep-alive" packets are specific to TCP. */
-	if (domain == AF_INET && type == SOCK_STREAM) {
+	if ((domain == AF_INET
+#if defined(_PR_INET6)
+			|| domain == AF_INET6
+#endif
+			) && type == SOCK_STREAM) {
 		if (setsockopt(osfd, (int)SOL_SOCKET, SO_KEEPALIVE,
 #ifdef XP_OS2_VACPP
             (char *)&one, sizeof(one) ) < 0) {
 #else
 		    (const void *) &one, sizeof(one) ) < 0) {
 #endif
 			_PR_MD_CLOSE_SOCKET(osfd);
 			return 0;