PORT_Assert( ssl_HaveRecvBufLock(ss) );
PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) );
ssl3_GatherCompleteHandshake(sslSocket *ss, int flags){    SSL3Ciphertext cText;    int            rv;    PORT_Assert( ssl_HaveRecvBufLock(ss) );    do {	/* bring in the next sslv3 record. */	rv = ssl3_GatherData(ss, &ss->gs, flags);	if (rv <= 0) {	    return rv;	}		/* decipher it, and handle it if it's a handshake. 	 * If it's application data, ss->gs.buf will not be empty upon return. 	 */	cText.type    = (SSL3ContentType)ss->gs.hdr[0];	cText.version = (ss->gs.hdr[1] << 8) | ss->gs.hdr[2];	cText.buf     = &ss->gs.inbuf;	rv = ssl3_HandleRecord(ss, &cText, &ss->gs.buf);	if (rv < 0) {	    return ss->recvdCloseNotify ? 0 : rv;	}    } while (ss->ssl3->hs.ws != idle_handshake && ss->gs.buf.len == 0);    ss->gs.readOffset = 0;    ss->gs.writeOffset = ss->gs.buf.len;    return 1;}