Diff
Not logged in

Differences From Artifact [adf10fe086]:

To Artifact [fb987fbb11]:


1391
1392
1393
1394
1395
1396
1397






1398
1399
1400
1401
1402
1403
1404
    infoPtr->flags &= ~(SOCKET_ASYNC_CONNECT);
    if ( Tcl_GetErrno() != 0 ) {
	DEBUG("ERRNO");
	if (interp != NULL) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
				"couldn't open socket: %s", Tcl_PosixError(interp)));
	}






	return TCL_ERROR;
    }
    /*
     * Set up the select mask for read/write events.
     */
    DEBUG("selectEvents = FD_READ | FD_WRITE | FD_CLOSE");    
    infoPtr->selectEvents = FD_READ | FD_WRITE | FD_CLOSE;







>
>
>
>
>
>







1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
    infoPtr->flags &= ~(SOCKET_ASYNC_CONNECT);
    if ( Tcl_GetErrno() != 0 ) {
	DEBUG("ERRNO");
	if (interp != NULL) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
				"couldn't open socket: %s", Tcl_PosixError(interp)));
	}
	/*
	 * In the final error case inform fileevent that we failed
	 */
	if (async_callback) {
	    Tcl_NotifyChannel(infoPtr->channel, TCL_WRITABLE);
	}
	return TCL_ERROR;
    }
    /*
     * Set up the select mask for read/write events.
     */
    DEBUG("selectEvents = FD_READ | FD_WRITE | FD_CLOSE");    
    infoPtr->selectEvents = FD_READ | FD_WRITE | FD_CLOSE;
1419
1420
1421
1422
1423
1424
1425
1426


1427

1428
1429
1430
1431
1432
1433
1434

1435
1436
1437
1438
1439
1440
1441
}

/*
 *----------------------------------------------------------------------
 *
 * WaitForConnect --
 *
 *	Terminate an asyncroneous connect syncroneously.


 *	This routine should only be called if flag ASYNC_CONNECT is set.

 *
 * Results:
 *	Returns 1 on success or 0 on failure, with an error code in
 *	errorCodePtr.
 *
 * Side effects:
 *	Processes socket events off the system queue.

 *
 *----------------------------------------------------------------------
 */

static int
WaitForConnect(
    SocketInfo *infoPtr,	/* Information about this socket. */







|
>
>
|
>







>







1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
}

/*
 *----------------------------------------------------------------------
 *
 * WaitForConnect --
 *
 *	Process an asyncroneous connect by gets/puts commands.
 *	For blocking calls, terminate connect synchroneously.
 *	For non blocking calls, do one asynchroneous step if possible.
 *	This routine should only be called if flag SOCKET_REENTER_PENDING
 *	is set.
 *
 * Results:
 *	Returns 1 on success or 0 on failure, with an error code in
 *	errorCodePtr.
 *
 * Side effects:
 *	Processes socket events off the system queue.
 *	May process asynchroneous connect.
 *
 *----------------------------------------------------------------------
 */

static int
WaitForConnect(
    SocketInfo *infoPtr,	/* Information about this socket. */