summaryrefslogtreecommitdiff
path: root/code/core/rbuf_recv.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2017-09-09 12:43:40 +0200
committerUros Majstorovic <majstor@majstor.org>2017-09-09 12:43:40 +0200
commit4e0c427c546a6d664642f68cc6d11f879c537d29 (patch)
treeac436ce8da05c52ee1e0e1b1a7bad1f4008c8afe /code/core/rbuf_recv.c
parent8d3e76d078cf1fd9d295391735ca4208eaa5f3de (diff)
fragments test added
Diffstat (limited to 'code/core/rbuf_recv.c')
-rw-r--r--code/core/rbuf_recv.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/code/core/rbuf_recv.c b/code/core/rbuf_recv.c
index 5b8568e..fc2b6ab 100644
--- a/code/core/rbuf_recv.c
+++ b/code/core/rbuf_recv.c
@@ -219,7 +219,7 @@ int ecp_rbuf_recv_create(ECPConnection *conn, ECPRBRecv *buf, ECPRBMessage *msg,
buf->ack_rate = ACK_RATE;
#ifdef ECP_WITH_MSGQ
- rv = ecp_conn_msgq_create(conn);
+ rv = ecp_conn_msgq_create(&buf->msgq);
if (rv) return rv;
#endif
@@ -228,9 +228,14 @@ int ecp_rbuf_recv_create(ECPConnection *conn, ECPRBRecv *buf, ECPRBMessage *msg,
}
void ecp_rbuf_recv_destroy(ECPConnection *conn) {
+ ECPRBRecv *buf = conn->rbuf.recv;
+
+ if (buf == NULL) return;
#ifdef ECP_WITH_MSGQ
- ecp_conn_msgq_destroy(conn);
-#endif
+ ecp_conn_msgq_destroy(&buf->msgq);
+#endif
+
+ conn->rbuf.recv = NULL;
}
int ecp_rbuf_recv_set_hole(ECPConnection *conn, unsigned short hole_max) {