PRFileDesc *        ssl_sock; PRFileDesc *        tcp_sock;
PRFileDesc *        ssl_sock	= 0; PRFileDesc *        tcp_sock	= 0;
do_connects(    void *	a,    void *	b,    int         connection){    PRNetAddr  *        addr		= (PRNetAddr *)  a;    PRFileDesc *        model_sock	= (PRFileDesc *) b;    PRFileDesc *        ssl_sock;    PRFileDesc *        tcp_sock;    PRStatus	        prStatus;    SECStatus   	result;    int                 rv 		= SECSuccess;    PRSocketOptionData  opt;retry:    tcp_sock = PR_NewTCPSocket();    if (tcp_sock == NULL) {	errExit("PR_NewTCPSocket");    }    opt.option             = PR_SockOpt_Nonblocking;    opt.value.non_blocking = PR_FALSE;    prStatus = PR_SetSocketOption(tcp_sock, &opt);    if (prStatus != PR_SUCCESS) {    	PR_Close(tcp_sock);	return SECSuccess;    }     prStatus = PR_Connect(tcp_sock, addr, PR_INTERVAL_NO_TIMEOUT);    if (prStatus != PR_SUCCESS) {	PRErrorCode err = PR_GetError();	if (err == PR_CONNECT_REFUSED_ERROR) {	    PR_Close(tcp_sock);	    PR_Sleep(PR_MillisecondsToInterval(10));	    goto retry;	}	errWarn("PR_Connect");	goto done;    }    ssl_sock = SSL_ImportFD(model_sock, tcp_sock);    /* XXX if this import fails, close tcp_sock and return. */    if (!ssl_sock) {    	PR_Close(tcp_sock);	return SECSuccess;    }    rv = SSL_ResetHandshake(ssl_sock, /* asServer */ 0);    if (rv != SECSuccess) {	errWarn("SSL_ResetHandshake");	goto done;    }    if (bigBuf.data != NULL) {	result = handle_fdx_connection( ssl_sock, connection);    } else {	result = handle_connection( ssl_sock, connection);    }done:    PR_Close(ssl_sock);    return SECSuccess;}