From 5d20e9bafc3571f37eb0d9b74699d023d2d3d13a Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 18 Aug 2017 20:35:21 +0200 Subject: timer fixed; rbuf almost implemented --- code/core/msgq.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'code/core/msgq.c') diff --git a/code/core/msgq.c b/code/core/msgq.c index 15629c8..4c1252b 100644 --- a/code/core/msgq.c +++ b/code/core/msgq.c @@ -79,7 +79,9 @@ int ecp_conn_msgq_push(ECPConnection *conn, ecp_seq_t seq, unsigned char mtype) ECPRBRecv *buf = conn->rbuf.recv; ECPConnMsgQ *msgq = buf ? &buf->msgq : NULL; + mtype &= ECP_MTYPE_MASK; if (msgq == NULL) return ECP_ERR; + if (mtype >= ECP_MAX_MTYPE) return ECP_ERR_MAX_MTYPE; if (msgq->idx_w[mtype] - msgq->idx_r[mtype] == ECP_MSGQ_MAX_MSG) return ECP_MSGQ_ERR_MAX_MSG; if (msgq->idx_w[mtype] == msgq->idx_r[mtype]) pthread_cond_signal(&msgq->cond[mtype]); -- cgit v1.2.3