Commit 6a25f699 authored by gordon%netscape.com's avatar gordon%netscape.com
Browse files

Fix for Mac OT bugs #4251. Added a case for OTGetEndpointState() returning...

Fix for Mac OT bugs #4251.  Added a case for OTGetEndpointState() returning T_INREL to avoid calling PR_ASSERT.  Also removed call to macsock_map_error() in notification routine because it makes assumptions concerning the current thread that are not valid from an interrupt.
parent f7b81ab3
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -213,7 +213,6 @@ pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResult resul
    PRThread *    thread   = NULL;
    _PRCPU *      cpu      = _PR_MD_CURRENT_CPU(); 
	OSStatus      err;
    TDiscon       discon;
	OTResult	  resultOT;

    switch (code)
@@ -249,10 +248,8 @@ pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResult resul
			return;

        case T_DISCONNECT:  // A disconnect is available
            memset(&discon, 0 , sizeof(discon));
            err = OTRcvDisconnect(endpoint, &discon);
            err = OTRcvDisconnect(endpoint, NULL);
            PR_ASSERT(err == kOTNoError);
            macsock_map_error(discon.reason);
            fd->secret->md.exceptReady     = PR_TRUE;
            fd->secret->md.connectionOpen  = PR_FALSE;
            break;
@@ -1716,6 +1713,9 @@ int _MD_mac_get_nonblocking_connect_error(PRInt32 osfd)
            return 0;
        case T_IDLE:
            return -1;
        case T_INREL:
        	macsock_map_error(ENOTCONN);
        	return -1;
        default:
            PR_ASSERT(0);
            return -1;