diff options
author | Uros Majstorovic <majstor@majstor.org> | 2017-09-09 12:49:56 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2017-09-09 12:49:56 +0200 |
commit | 55364a819692d63080d23e6dc30daf38f02f5524 (patch) | |
tree | 7fd940ef9f2ac3d6e4e528f24237a5451f232dc4 | |
parent | 4e0c427c546a6d664642f68cc6d11f879c537d29 (diff) |
msgq minor fix
-rw-r--r-- | code/core/msgq.c | 5 | ||||
-rw-r--r-- | code/core/msgq.h | 2 | ||||
-rw-r--r-- | code/core/rbuf_recv.c | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/code/core/msgq.c b/code/core/msgq.c index 45df608..b928a2d 100644 --- a/code/core/msgq.c +++ b/code/core/msgq.c @@ -59,10 +59,7 @@ void ecp_conn_msgq_destroy(ECPConnMsgQ *msgq) { pthread_mutex_destroy(&msgq->mutex); } -int ecp_conn_msgq_start(ECPConnection *conn, ecp_seq_t seq) { - ECPRBRecv *buf = conn->rbuf.recv; - ECPConnMsgQ *msgq = buf ? &buf->msgq : NULL; - +int ecp_conn_msgq_start(ECPConnMsgQ *msgq, ecp_seq_t seq) { if (msgq == NULL) return ECP_ERR; msgq->seq_max = seq; diff --git a/code/core/msgq.h b/code/core/msgq.h index a98ae18..41e819b 100644 --- a/code/core/msgq.h +++ b/code/core/msgq.h @@ -18,7 +18,7 @@ typedef struct ECPConnMsgQ { int ecp_conn_msgq_create(ECPConnMsgQ *msgq); void ecp_conn_msgq_destroy(ECPConnMsgQ *msgq); -int ecp_conn_msgq_start(struct ECPConnection *conn, ecp_seq_t seq); +int ecp_conn_msgq_start(ECPConnMsgQ *msgq, ecp_seq_t seq); int ecp_conn_msgq_push(struct ECPConnection *conn, ecp_seq_t seq, unsigned char mtype); ssize_t ecp_conn_msgq_pop(struct ECPConnection *conn, unsigned char mtype, unsigned char *msg, size_t msg_size, ecp_cts_t timeout); diff --git a/code/core/rbuf_recv.c b/code/core/rbuf_recv.c index fc2b6ab..2217bfc 100644 --- a/code/core/rbuf_recv.c +++ b/code/core/rbuf_recv.c @@ -269,7 +269,7 @@ int ecp_rbuf_recv_start(ECPConnection *conn, ecp_seq_t seq) { #ifdef ECP_WITH_MSGQ if (buf->flags & ECP_RBUF_FLAG_MSGQ) { - rv = ecp_conn_msgq_start(conn, seq); + rv = ecp_conn_msgq_start(&buf->msgq, seq); if (rv) return rv; } #endif |