/* recvrec_buf, recvrec_ack receives bytes from transport medium sendrec_buf, sendrec_ack send bytes to transport medium recvpld_buf, recvpld_ack receives payload data from engine sendpld_buf, sendpld_ack send payload data to engine  */
static unsigned char* recvrec_buf(const br_ssl_engine_context *rc, size_t *len)
/* recvrec_buf, recvrec_ack receives bytes from transport medium sendrec_buf, sendrec_ack send bytes to transport medium recvpld_buf, recvpld_ack receives payload data from engine sendpld_buf, sendpld_ack send payload data to engine  */
static unsigned char* recvrec_buf(const br_ssl_engine_context *rc, size_t *len)
{
	if (rc->shutdown_recv) {
		*len = 0;
		return NULL;
	}
	switch (rc->iomode) {
	case BR_IO_IN:
	case BR_IO_INOUT:
		if (rc->ixa == rc->ixb) {
			size_t z;
			z = rc->ixc;
			if (z > rc->ibuf_len - rc->ixa) {
				z = rc->ibuf_len - rc->ixa;
			}
			*len = z;
			return rc->ibuf + rc->ixa;
		}
		break;
	}
	*len = 0;
	return NULL;
}