summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>1999-10-26 22:58:55 +0000
committerwtc%netscape.com <devnull@localhost>1999-10-26 22:58:55 +0000
commit2d0ad2c2255f77539a27c7cfa555765c62465263 (patch)
treebed6d0310ae8673cdcc437ae28d0c78af07304fb
parent8598fbc12b47bf35b460e1022876bfbc9b313faf (diff)
downloadnspr-hg-2d0ad2c2255f77539a27c7cfa555765c62465263.tar.gz
Bugzilla bug #17188: NSPR should not automatically set the SO_KEEPALIVE
socket option on a new TCP socket. The HAVE_SOCKET_KEEPALIVE macro is obsolete. r=srinivas@netscape.com. Modified files: _beos.h, _os2.h, _unixos.h, _win16.h, _win95.h, _winnt.h, prsocket.c, and ptio.c.
-rw-r--r--pr/include/md/_beos.h2
-rw-r--r--pr/include/md/_os2.h1
-rw-r--r--pr/include/md/_unixos.h2
-rw-r--r--pr/include/md/_win16.h1
-rw-r--r--pr/include/md/_win95.h1
-rw-r--r--pr/include/md/_winnt.h1
-rw-r--r--pr/src/io/prsocket.c19
-rw-r--r--pr/src/pthreads/ptio.c4
8 files changed, 1 insertions, 30 deletions
diff --git a/pr/include/md/_beos.h b/pr/include/md/_beos.h
index bd3f8a7e..64ca7c93 100644
--- a/pr/include/md/_beos.h
+++ b/pr/include/md/_beos.h
@@ -143,8 +143,6 @@ struct _MDDir {
#define PR_PATH_SEPARATOR ':'
#define PR_PATH_SEPARATOR_STR ":"
-#undef HAVE_SOCKET_KEEPALIVE
-
#define GETTIMEOFDAY(tp) gettimeofday((tp), NULL)
/* --- Memory-mapped files stuff --- not implemented on BeOS */
diff --git a/pr/include/md/_os2.h b/pr/include/md/_os2.h
index f2862480..4c0fffa5 100644
--- a/pr/include/md/_os2.h
+++ b/pr/include/md/_os2.h
@@ -55,7 +55,6 @@
#define HAVE_DLL
#undef HAVE_THREAD_AFFINITY
-#define HAVE_SOCKET_KEEPALIVE
#undef _PR_HAVE_ATOMIC_OPS
#define HANDLE unsigned long
diff --git a/pr/include/md/_unixos.h b/pr/include/md/_unixos.h
index f2344b3b..e44ab7b8 100644
--- a/pr/include/md/_unixos.h
+++ b/pr/include/md/_unixos.h
@@ -442,8 +442,6 @@ extern PRStatus _MD_getsysinfo(PRSysInfo cmd, char *name, PRUint32 namelen);
extern int _MD_unix_get_nonblocking_connect_error(int osfd);
-#define HAVE_SOCKET_KEEPALIVE
-
/* Memory-mapped files */
struct _MDFileMap {
diff --git a/pr/include/md/_win16.h b/pr/include/md/_win16.h
index a58e53a1..8788659f 100644
--- a/pr/include/md/_win16.h
+++ b/pr/include/md/_win16.h
@@ -41,7 +41,6 @@
#define _PR_LOCAL_THREADS_ONLY
#undef _PR_GLOBAL_THREADS_ONLY
#undef HAVE_THREAD_AFFINITY
-#define HAVE_SOCKET_KEEPALIVE
#define _PR_HAVE_ATOMIC_OPS
/* --- Common User-Thread/Native-Thread Definitions --------------------- */
diff --git a/pr/include/md/_win95.h b/pr/include/md/_win95.h
index a993c6b7..e82ddfe3 100644
--- a/pr/include/md/_win95.h
+++ b/pr/include/md/_win95.h
@@ -35,7 +35,6 @@
#define HAVE_DLL
#undef HAVE_THREAD_AFFINITY
-#define HAVE_SOCKET_KEEPALIVE
#define _PR_HAVE_ATOMIC_OPS
#define PR_HAVE_WIN32_NAMED_SHARED_MEMORY
diff --git a/pr/include/md/_winnt.h b/pr/include/md/_winnt.h
index 15e605ca..77db2ddb 100644
--- a/pr/include/md/_winnt.h
+++ b/pr/include/md/_winnt.h
@@ -47,7 +47,6 @@
#define HAVE_DLL
#define HAVE_CUSTOM_USER_THREADS
#define HAVE_THREAD_AFFINITY
-#define HAVE_SOCKET_KEEPALIVE
#define _PR_HAVE_ATOMIC_OPS
#define _PR_HAVE_ATOMIC_CAS
#define PR_HAVE_WIN32_NAMED_SHARED_MEMORY
diff --git a/pr/src/io/prsocket.c b/pr/src/io/prsocket.c
index 406e19bc..f0fdeb9e 100644
--- a/pr/src/io/prsocket.c
+++ b/pr/src/io/prsocket.c
@@ -1183,7 +1183,6 @@ static const PRIOMethods* PR_GetSocketPollFdMethods()
PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto)
{
PRInt32 osfd;
- int one = 1;
PRFileDesc *fd;
if (!_pr_initialized) _PR_ImplicitInitialization();
@@ -1202,24 +1201,6 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto)
if (osfd == -1) {
return 0;
}
-#ifdef HAVE_SOCKET_KEEPALIVE
- /* "Keep-alive" packets are specific to TCP. */
- 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;
- }
- }
-#endif
if (type == SOCK_STREAM)
fd = PR_AllocFileDesc(osfd, PR_GetTCPMethods());
else
diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c
index 35112ad4..68a8778c 100644
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -3072,7 +3072,7 @@ static PRIOMethods _pr_socketpollfd_methods = {
static PRFileDesc *pt_SetMethods(PRIntn osfd, PRDescType type)
{
- PRInt32 flags, one = 1;
+ PRInt32 flags;
PRFileDesc *fd = _PR_Getfd();
if (fd == NULL) PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
@@ -3101,8 +3101,6 @@ static PRFileDesc *pt_SetMethods(PRIntn osfd, PRDescType type)
flags = fcntl(osfd, F_GETFL, 0);
flags |= _PR_FCNTL_FLAGS;
(void)fcntl(osfd, F_SETFL, flags);
- (void)setsockopt(osfd, SOL_SOCKET, SO_KEEPALIVE,
- (_PRSockOptVal_t) &one, sizeof(one));
break;
case PR_DESC_SOCKET_UDP:
fd->methods = PR_GetUDPMethods();