Bugzilla bug #40778: added new function PR_ConnectContinue and new
authorwtc%netscape.com
Fri, 02 Jun 2000 02:07:56 +0000
changeset 1402 1c80203367357cfe51e8c64a120348f3d71fa78a
parent 1401 552fbbb7a0953b46cbf8b06885a57ff58e4c0f7e
child 1403 10902453b880ae769c588e48cb3c4226a41b910b
push idunknown
push userunknown
push dateunknown
bugs40778
Bugzilla bug #40778: added new function PR_ConnectContinue and new I/O method connectcontinue. Deprecate PR_GetConnectStatus and define it in terms of PR_ConnectContinue. Modified files: prio.h, prfile.c, priometh.c, prlayer.c, prpolevt.c, prsocket.c, ptio.c
pr/include/prio.h
pr/src/io/prfile.c
pr/src/io/priometh.c
pr/src/io/prlayer.c
pr/src/io/prpolevt.c
pr/src/io/prsocket.c
pr/src/pthreads/ptio.c
--- a/pr/include/prio.h
+++ b/pr/include/prio.h
@@ -340,16 +340,18 @@ typedef PRStatus (PR_CALLBACK *PRGetsock
 typedef PRStatus (PR_CALLBACK *PRGetpeernameFN)(PRFileDesc *fd, PRNetAddr *addr);
 typedef PRStatus (PR_CALLBACK *PRGetsocketoptionFN)(
     PRFileDesc *fd, PRSocketOptionData *data);
 typedef PRStatus (PR_CALLBACK *PRSetsocketoptionFN)(
     PRFileDesc *fd, const PRSocketOptionData *data);
 typedef PRInt32 (PR_CALLBACK *PRSendfileFN)(
 	PRFileDesc *networkSocket, PRSendFileData *sendData,
 	PRTransmitFileFlags flags, PRIntervalTime timeout);
+typedef PRStatus (PR_CALLBACK *PRConnectcontinueFN)(
+    PRFileDesc *fd, PRInt16 out_flags);
 typedef PRIntn (PR_CALLBACK *PRReservedFN)(PRFileDesc *fd);
 
 struct PRIOMethods {
     PRDescType file_type;           /* Type of file represented (tos)           */
     PRCloseFN close;                /* close file and destroy descriptor        */
     PRReadFN read;                  /* read up to specified bytes into buffer   */
     PRWriteFN write;                /* write specified bytes from buffer        */
     PRAvailableFN available;        /* determine number of bytes available      */
@@ -376,17 +378,18 @@ struct PRIOMethods {
     PRGetpeernameFN getpeername;    /* Get peer's (net) address                 */
     PRReservedFN reserved_fn_6;     /* reserved for future use */
     PRReservedFN reserved_fn_5;     /* reserved for future use */
     PRGetsocketoptionFN getsocketoption;
                                     /* Get current setting of specified option  */
     PRSetsocketoptionFN setsocketoption;
                                     /* Set value of specified option            */
     PRSendfileFN sendfile;			/* Send a (partial) file with header/trailer*/
-    PRReservedFN reserved_fn_4;		/* reserved for future use */
+    PRConnectcontinueFN connectcontinue;
+                                    /* Continue a nonblocking connect */
     PRReservedFN reserved_fn_3;		/* reserved for future use */
     PRReservedFN reserved_fn_2;		/* reserved for future use */
     PRReservedFN reserved_fn_1;		/* reserved for future use */
     PRReservedFN reserved_fn_0;		/* reserved for future use */
 };
 
 /*
  **************************************************************************
@@ -1197,16 +1200,52 @@ NSPR_API(PRFileDesc*)    PR_OpenTCPSocke
  **************************************************************************
  */
 
 NSPR_API(PRStatus) PR_Connect(
     PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout);
 
 /*
  *************************************************************************
+ * FUNCTION: PR_ConnectContinue
+ * DESCRIPTION:
+ *     Continue a nonblocking connect.  After a nonblocking connect
+ *     is initiated with PR_Connect() (which fails with
+ *     PR_IN_PROGRESS_ERROR), one should call PR_Poll() on the socket,
+ *     with the in_flags PR_POLL_WRITE | PR_POLL_EXCEPT.  When
+ *     PR_Poll() returns, one calls PR_ConnectContinue() on the
+ *     socket to determine whether the nonblocking connect has
+ *     completed or is still in progress.  Repeat the PR_Poll(),
+ *     PR_ConnectContinue() sequence until the nonblocking connect
+ *     has completed.
+ * INPUTS:
+ *     PRFileDesc *fd
+ *         the file descriptor representing a socket
+ *     PRInt16 out_flags
+ *         the out_flags field of the poll descriptor returned by
+ *         PR_Poll()
+ * RETURN: PRStatus
+ *     If the nonblocking connect has successfully completed,
+ *     PR_GetConnectStatus returns PR_SUCCESS.  If PR_GetConnectStatus()
+ *     returns PR_FAILURE, call PR_GetError():
+ *     - PR_IN_PROGRESS_ERROR: the nonblocking connect is still in
+ *       progress and has not completed yet.  The caller should poll
+ *       on the file descriptor for the in_flags
+ *       PR_POLL_WRITE|PR_POLL_EXCEPT and retry PR_ConnectContinue
+ *       later when PR_Poll() returns.
+ *     - Other errors: the nonblocking connect has failed with this
+ *       error code.
+ */
+
+NSPR_API(PRStatus)    PR_ConnectContinue(PRFileDesc *fd, PRInt16 out_flags);
+
+/*
+ *************************************************************************
+ * THIS FUNCTION IS DEPRECATED.  USE PR_ConnectContinue INSTEAD.
+ *
  * FUNCTION: PR_GetConnectStatus
  * DESCRIPTION:
  *     Get the completion status of a nonblocking connect.  After
  *     a nonblocking connect is initiated with PR_Connect() (which
  *     fails with PR_IN_PROGRESS_ERROR), one should call PR_Poll()
  *     on the socket, with the in_flags PR_POLL_WRITE | PR_POLL_EXCEPT.
  *     When PR_Poll() returns, one calls PR_GetConnectStatus on the
  *     PRPollDesc structure to determine whether the nonblocking
--- a/pr/src/io/prfile.c
+++ b/pr/src/io/prfile.c
@@ -268,17 +268,17 @@ static PRIOMethods _pr_fileMethods = {
     (PRTransmitfileFN)_PR_InvalidInt, 
     (PRGetsocknameFN)_PR_InvalidStatus,	
     (PRGetpeernameFN)_PR_InvalidStatus,	
     (PRReservedFN)_PR_InvalidInt,	
     (PRReservedFN)_PR_InvalidInt,	
     (PRGetsocketoptionFN)_PR_InvalidStatus,	
     (PRSetsocketoptionFN)_PR_InvalidStatus,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt, 
+    (PRConnectcontinueFN)_PR_InvalidStatus, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 PR_IMPLEMENT(const PRIOMethods*) PR_GetFileMethods(void)
 {
@@ -312,17 +312,17 @@ static PRIOMethods _pr_pipeMethods = {
     (PRTransmitfileFN)_PR_InvalidInt, 
     (PRGetsocknameFN)_PR_InvalidStatus,	
     (PRGetpeernameFN)_PR_InvalidStatus,	
     (PRReservedFN)_PR_InvalidInt,	
     (PRReservedFN)_PR_InvalidInt,	
     (PRGetsocketoptionFN)_PR_InvalidStatus,	
     (PRSetsocketoptionFN)_PR_InvalidStatus,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt, 
+    (PRConnectcontinueFN)_PR_InvalidStatus, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 PR_IMPLEMENT(const PRIOMethods*) PR_GetPipeMethods(void)
 {
--- a/pr/src/io/priometh.c
+++ b/pr/src/io/priometh.c
@@ -48,17 +48,17 @@ PRIOMethods _pr_faulty_methods = {
     (PRTransmitfileFN)_PR_InvalidInt, 
     (PRGetsocknameFN)_PR_InvalidStatus,    
     (PRGetpeernameFN)_PR_InvalidStatus,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRGetsocketoptionFN)_PR_InvalidStatus,
     (PRSetsocketoptionFN)_PR_InvalidStatus,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt,
+    (PRConnectcontinueFN)_PR_InvalidStatus,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt
 };
 
 PRIntn _PR_InvalidInt()
 {
@@ -161,16 +161,22 @@ PR_IMPLEMENT(PRStatus) PR_Sync(PRFileDes
 }
 
 PR_IMPLEMENT(PRStatus) PR_Connect(
     PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout)
 {
 	return((fd->methods->connect)(fd,addr,timeout));
 }
 
+PR_IMPLEMENT(PRStatus) PR_ConnectContinue(
+    PRFileDesc *fd, PRInt16 out_flags)
+{
+	return((fd->methods->connectcontinue)(fd,out_flags));
+}
+
 PR_IMPLEMENT(PRFileDesc*) PR_Accept(PRFileDesc *fd, PRNetAddr *addr,
 PRIntervalTime timeout)
 {
 	return((fd->methods->accept)(fd,addr,timeout));
 }
 
 PR_IMPLEMENT(PRStatus) PR_Bind(PRFileDesc *fd, const PRNetAddr *addr)
 {
--- a/pr/src/io/prlayer.c
+++ b/pr/src/io/prlayer.c
@@ -170,16 +170,25 @@ static PRStatus PR_CALLBACK pl_DefConnec
     PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout)
 {
     PR_ASSERT(fd != NULL);
     PR_ASSERT(fd->lower != NULL);
 
     return (fd->lower->methods->connect)(fd->lower, addr, timeout);
 }
 
+static PRStatus PR_CALLBACK pl_DefConnectcontinue (
+    PRFileDesc *fd, PRInt16 out_flags)
+{
+    PR_ASSERT(fd != NULL);
+    PR_ASSERT(fd->lower != NULL);
+
+    return (fd->lower->methods->connectcontinue)(fd->lower, out_flags);
+}
+
 static PRFileDesc* PR_CALLBACK pl_TopAccept (
     PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
 {
     PRStatus rv;
     PRFileDesc *newfd, *layer = fd;
     PRFileDesc *newstack;
 	PRBool newstyle_stack = PR_FALSE;
 
@@ -422,17 +431,17 @@ static PRIOMethods pl_methods = {
     pl_DefTransmitfile,
     pl_DefGetsockname,
     pl_DefGetpeername,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt,
     pl_DefGetsocketoption,
     pl_DefSetsocketoption,
     pl_DefSendfile,
-    (PRReservedFN)_PR_InvalidInt,
+    pl_DefConnectcontinue,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt
 };
 
 PR_IMPLEMENT(const PRIOMethods*) PR_GetDefaultIOMethods()
 {
--- a/pr/src/io/prpolevt.c
+++ b/pr/src/io/prpolevt.c
@@ -169,17 +169,17 @@ static PRIOMethods _pr_polevt_methods = 
     (PRTransmitfileFN)_PR_InvalidInt, 
     (PRGetsocknameFN)_PR_InvalidStatus,    
     (PRGetpeernameFN)_PR_InvalidStatus,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRGetsocketoptionFN)_PR_InvalidStatus,
     (PRSetsocketoptionFN)_PR_InvalidStatus,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt, 
+    (PRConnectcontinueFN)_PR_InvalidStatus, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 static PRDescIdentity _pr_polevt_id;
 static PRCallOnceType _pr_polevt_once_control;
--- a/pr/src/io/prsocket.c
+++ b/pr/src/io/prsocket.c
@@ -248,36 +248,33 @@ static PRStatus PR_CALLBACK SocketConnec
 	rv = _PR_MD_CONNECT(fd, addrp, PR_NETADDR_SIZE(addr), timeout);
 	PR_LOG(_pr_io_lm, PR_LOG_MAX, ("connect -> %d", rv));
 	if (rv == 0)
 		return PR_SUCCESS;
 	else
 		return PR_FAILURE;
 }
 
-PR_IMPLEMENT(PRStatus) PR_GetConnectStatus(const PRPollDesc *pd)
+static PRStatus PR_CALLBACK SocketConnectContinue(
+    PRFileDesc *fd, PRInt16 out_flags)
 {
     PRInt32 osfd;
-    PRFileDesc *bottom = pd->fd;
     int err;
 
-    if (pd->out_flags & PR_POLL_NVAL) {
+    if (out_flags & PR_POLL_NVAL) {
         PR_SetError(PR_BAD_DESCRIPTOR_ERROR, 0);
         return PR_FAILURE;
     }
-    if ((pd->out_flags & (PR_POLL_WRITE | PR_POLL_EXCEPT | PR_POLL_ERR)) == 0) {
-        PR_ASSERT(pd->out_flags == 0);
+    if ((out_flags & (PR_POLL_WRITE | PR_POLL_EXCEPT | PR_POLL_ERR)) == 0) {
+        PR_ASSERT(out_flags == 0);
         PR_SetError(PR_IN_PROGRESS_ERROR, 0);
         return PR_FAILURE;
     }
 
-    while (bottom->lower != NULL) {
-        bottom = bottom->lower;
-    }
-    osfd = bottom->secret->md.osfd;
+    osfd = fd->secret->md.osfd;
 
 #if defined(XP_UNIX)
 
     err = _MD_unix_get_nonblocking_connect_error(osfd);
     if (err != 0) {
         _PR_MD_MAP_CONNECT_ERROR(err);
         return PR_FAILURE;
     }
@@ -288,78 +285,90 @@ PR_IMPLEMENT(PRStatus) PR_GetConnectStat
 #if defined(WIN32)
     /*
      * The sleep circumvents a bug in Win32 WinSock.
      * See Microsoft Knowledge Base article ID: Q165989.
      */
     Sleep(0);
 #endif /* WIN32 */
 
-    if (pd->out_flags & PR_POLL_EXCEPT) {
+    if (out_flags & PR_POLL_EXCEPT) {
         int len = sizeof(err);
         if (getsockopt(osfd, (int)SOL_SOCKET, SO_ERROR, (char *) &err, &len)
                 == SOCKET_ERROR) {
             _PR_MD_MAP_GETSOCKOPT_ERROR(WSAGetLastError());
             return PR_FAILURE;
         }
         if (err != 0) {
             _PR_MD_MAP_CONNECT_ERROR(err);
         } else {
             PR_SetError(PR_UNKNOWN_ERROR, 0);
         }
         return PR_FAILURE;
     }
 
-    PR_ASSERT(pd->out_flags & PR_POLL_WRITE);
+    PR_ASSERT(out_flags & PR_POLL_WRITE);
     return PR_SUCCESS;
 
 #elif defined(XP_OS2)
 
-    if (pd->out_flags & PR_POLL_EXCEPT) {
+    if (out_flags & PR_POLL_EXCEPT) {
         int len = sizeof(err);
         if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char *) &err, &len)
                 < 0) {
             _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno());
             return PR_FAILURE;
         }
         if (err != 0) {
             _PR_MD_MAP_CONNECT_ERROR(err);
         } else {
             PR_SetError(PR_UNKNOWN_ERROR, 0);
         }
         return PR_FAILURE;
     }
 
-    PR_ASSERT(pd->out_flags & PR_POLL_WRITE);
+    PR_ASSERT(out_flags & PR_POLL_WRITE);
     return PR_SUCCESS;
 
 #elif defined(XP_MAC)
 
     err = _MD_mac_get_nonblocking_connect_error(osfd);
     if (err == -1)
         return PR_FAILURE;
 	else     
 		return PR_SUCCESS;
 
 #elif defined(XP_BEOS)
 
-    err = _MD_beos_get_nonblocking_connect_error(bottom);
+    err = _MD_beos_get_nonblocking_connect_error(fd);
     if( err != 0 ) {
 	_PR_MD_MAP_CONNECT_ERROR(err);
 	return PR_FAILURE;
     }
     else
 	return PR_SUCCESS;
 
 #else
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
     return PR_FAILURE;
 #endif
 }
 
+PR_IMPLEMENT(PRStatus) PR_GetConnectStatus(const PRPollDesc *pd)
+{
+    /* Find the NSPR layer and invoke its connectcontinue method */
+    PRFileDesc *bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER);
+
+    if (NULL == bottom) {
+        PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
+        return PR_FAILURE;
+    }
+    return bottom->methods->connectcontinue(pd->fd, pd->out_flags);
+}
+
 static PRFileDesc* PR_CALLBACK SocketAccept(PRFileDesc *fd, PRNetAddr *addr,
 PRIntervalTime timeout)
 {
 	PRInt32 osfd;
 	PRFileDesc *fd2;
 	PRUint32 al;
 	PRThread *me = _PR_MD_CURRENT_THREAD();
 #ifdef WINNT
@@ -1100,17 +1109,17 @@ static PRIOMethods tcpMethods = {
 	SocketTransmitFile,
 	SocketGetName,
 	SocketGetPeerName,
 	(PRReservedFN)_PR_InvalidInt,
 	(PRReservedFN)_PR_InvalidInt,
 	_PR_SocketGetSocketOption,
 	_PR_SocketSetSocketOption,
     SocketSendFile, 
-    (PRReservedFN)_PR_InvalidInt, 
+    SocketConnectContinue;
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 static PRIOMethods udpMethods = {
 	PR_DESC_SOCKET_UDP,
@@ -1139,17 +1148,17 @@ static PRIOMethods udpMethods = {
 	(PRTransmitfileFN)_PR_InvalidInt,
 	SocketGetName,
 	SocketGetPeerName,
 	(PRReservedFN)_PR_InvalidInt,
 	(PRReservedFN)_PR_InvalidInt,
 	_PR_SocketGetSocketOption,
 	_PR_SocketSetSocketOption,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt, 
+    (PRConnectcontinueFN)_PR_InvalidStatus, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 
 static PRIOMethods socketpollfdMethods = {
@@ -1179,17 +1188,17 @@ static PRIOMethods socketpollfdMethods =
     (PRTransmitfileFN)_PR_InvalidInt, 
     (PRGetsocknameFN)_PR_InvalidStatus,    
     (PRGetpeernameFN)_PR_InvalidStatus,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRGetsocketoptionFN)_PR_InvalidStatus,
     (PRSetsocketoptionFN)_PR_InvalidStatus,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt, 
+    (PRConnectcontinueFN)_PR_InvalidStatus, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 PR_IMPLEMENT(const PRIOMethods*) PR_GetTCPMethods()
 {
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -1343,45 +1343,57 @@ static PRStatus pt_Connect(
     }
     if (-1 == rv) {
         pt_MapError(_PR_MD_MAP_CONNECT_ERROR, syserrno);
         return PR_FAILURE;
     }
     return PR_SUCCESS;
 }  /* pt_Connect */
 
-PR_IMPLEMENT(PRStatus) PR_GetConnectStatus(const PRPollDesc *pd)
+static PRStatus pt_ConnectContinue(
+    PRFileDesc *fd, PRInt16 out_flags)
 {
     int err;
     PRInt32 osfd;
-    PRFileDesc *bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER);
-
-    if (NULL == bottom) {
-        PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
-        return PR_FAILURE;
-    }
-    if (pd->out_flags & PR_POLL_NVAL) {
+
+    if (out_flags & PR_POLL_NVAL)
+    {
         PR_SetError(PR_BAD_DESCRIPTOR_ERROR, 0);
         return PR_FAILURE;
     }
-    if ((pd->out_flags & (PR_POLL_WRITE | PR_POLL_EXCEPT | PR_POLL_ERR)) == 0) {
-        PR_ASSERT(pd->out_flags == 0);
+    if ((out_flags & (PR_POLL_WRITE | PR_POLL_EXCEPT | PR_POLL_ERR)) == 0)
+    {
+        PR_ASSERT(out_flags == 0);
         PR_SetError(PR_IN_PROGRESS_ERROR, 0);
         return PR_FAILURE;
     }
 
-    osfd = bottom->secret->md.osfd;
+    osfd = fd->secret->md.osfd;
 
     err = _MD_unix_get_nonblocking_connect_error(osfd);
-    if (err != 0) {
+    if (err != 0)
+    {
         _PR_MD_MAP_CONNECT_ERROR(err);
         return PR_FAILURE;
     }
     return PR_SUCCESS;
-}
+}  /* pt_ConnectContinue */
+
+PR_IMPLEMENT(PRStatus) PR_GetConnectStatus(const PRPollDesc *pd)
+{
+    /* Find the NSPR layer and invoke its connectcontinue method */
+    PRFileDesc *bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER);
+
+    if (NULL == bottom)
+    {
+        PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
+        return PR_FAILURE;
+    }
+    return bottom->methods->connectcontinue(pd->fd, pd->out_flags);
+}  /* PR_GetConnectStatus */
 
 static PRFileDesc* pt_Accept(
     PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
 {
     PRFileDesc *newfd = NULL;
     PRIntn syserrno, osfd = -1;
     pt_SockLen addr_len = sizeof(PRNetAddr);
 
@@ -2450,17 +2462,17 @@ static PRIOMethods _pr_file_methods = {
     (PRTransmitfileFN)_PR_InvalidInt, 
     (PRGetsocknameFN)_PR_InvalidStatus,    
     (PRGetpeernameFN)_PR_InvalidStatus,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRGetsocketoptionFN)_PR_InvalidStatus,
     (PRSetsocketoptionFN)_PR_InvalidStatus,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt, 
+    (PRConnectcontinueFN)_PR_InvalidStatus, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 static PRIOMethods _pr_pipe_methods = {
     PR_DESC_PIPE,
@@ -2489,17 +2501,17 @@ static PRIOMethods _pr_pipe_methods = {
     (PRTransmitfileFN)_PR_InvalidInt, 
     (PRGetsocknameFN)_PR_InvalidStatus,    
     (PRGetpeernameFN)_PR_InvalidStatus,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRGetsocketoptionFN)_PR_InvalidStatus,
     (PRSetsocketoptionFN)_PR_InvalidStatus,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt, 
+    (PRConnectcontinueFN)_PR_InvalidStatus, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 static PRIOMethods _pr_tcp_methods = {
     PR_DESC_SOCKET_TCP,
@@ -2528,17 +2540,17 @@ static PRIOMethods _pr_tcp_methods = {
     pt_TransmitFile,
     pt_GetSockName,
     pt_GetPeerName,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt,
     pt_GetSocketOption,
     pt_SetSocketOption,
     pt_SendFile, 
-    (PRReservedFN)_PR_InvalidInt, 
+    pt_ConnectContinue,
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 static PRIOMethods _pr_udp_methods = {
     PR_DESC_SOCKET_UDP,
@@ -2567,17 +2579,17 @@ static PRIOMethods _pr_udp_methods = {
     (PRTransmitfileFN)_PR_InvalidInt,
     pt_GetSockName,
     pt_GetPeerName,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt,
     pt_GetSocketOption,
     pt_SetSocketOption,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt, 
+    (PRConnectcontinueFN)_PR_InvalidStatus, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 static PRIOMethods _pr_socketpollfd_methods = {
     (PRDescType) 0,
@@ -2606,17 +2618,17 @@ static PRIOMethods _pr_socketpollfd_meth
     (PRTransmitfileFN)_PR_InvalidInt, 
     (PRGetsocknameFN)_PR_InvalidStatus,    
     (PRGetpeernameFN)_PR_InvalidStatus,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRReservedFN)_PR_InvalidInt,    
     (PRGetsocketoptionFN)_PR_InvalidStatus,
     (PRSetsocketoptionFN)_PR_InvalidStatus,
     (PRSendfileFN)_PR_InvalidInt, 
-    (PRReservedFN)_PR_InvalidInt, 
+    (PRConnectcontinueFN)_PR_InvalidStatus, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt, 
     (PRReservedFN)_PR_InvalidInt
 };
 
 #if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
     || defined(AIX) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD) \