PORT_Assert( ssl_HaveXmitBufLock(ss) );
PORT_Assert( ss->opt.noLocks || ssl_HaveXmitBufLock(ss) );
ssl2_SendClear(sslSocket *ss, const PRUint8 *in, PRInt32 len, PRInt32 flags){    PRUint8         * out;    int               rv;    int               amount;    int               count	= 0;    PORT_Assert( ssl_HaveXmitBufLock(ss) );    SSL_TRC(10, ("%d: SSL[%d]: sending %d bytes in the clear",		 SSL_GETPID(), ss->fd, len));    PRINT_BUF(50, (ss, "clear data:", (PRUint8*) in, len));    while (len) {	amount = PR_MIN( len, MAX_STREAM_CYPHER_LEN );	if (amount + 2 > ss->sec.writeBuf.space) {	    rv = sslBuffer_Grow(&ss->sec.writeBuf, amount + 2);	    if (rv != SECSuccess) {		count = rv;		break;	    }	}	out = ss->sec.writeBuf.buf;	/*	** Construct message.	*/	out[0] = 0x80 | MSB(amount);	out[1] = LSB(amount);	PORT_Memcpy(&out[2], in, amount);	/* Now send the data */	rv = ssl_DefSend(ss, out, amount + 2, flags & ~ssl_SEND_FLAG_MASK);	if (rv < 0) {	    if (PORT_GetError() == PR_WOULD_BLOCK_ERROR) {		rv = 0;	    } else {		/* Return short write if some data already went out... */		if (count == 0)		    count = rv;		break;	    }	}	if ((unsigned)rv < (amount + 2)) {	    /* Short write.  Save the data and return. */	    if (ssl_SaveWriteData(ss, &ss->pendingBuf, out + rv,				   amount + 2 - rv) == SECFailure) {		count = SECFailure;	    } else {		count += amount;		ss->sec.sendSequence++;	    }	    break;	}	ss->sec.sendSequence++;	in    += amount;	count += amount;	len   -= amount;    }    return count;}