diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-08-31 11:14:41 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-08-31 11:14:41 +0200 |
commit | 2a46bdf517eb5fcb8ba59c398a32859c6496475d (patch) | |
tree | d8773d60c6827cf6499b9fda98323feabc10e63f /ecp/src/rbuf_send.c | |
parent | ff7ffade2f5686ae977af578cb87040cc4654994 (diff) |
transient messages added; code cleanup
Diffstat (limited to 'ecp/src/rbuf_send.c')
-rw-r--r-- | ecp/src/rbuf_send.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ecp/src/rbuf_send.c b/ecp/src/rbuf_send.c index 13b314e..a680285 100644 --- a/ecp/src/rbuf_send.c +++ b/ecp/src/rbuf_send.c @@ -14,7 +14,7 @@ static ssize_t flush_send(ECPConnection *conn, ECPTimerItem *ti) { payload.buffer = pld_buf; payload.size = ECP_SIZE_PLD_BUF(0, ECP_MTYPE_RBFLUSH, conn); - ecp_pld_set_type(pld_buf, ECP_MTYPE_RBFLUSH); + ecp_pld_set_type(payload.buffer, payload.size, ECP_MTYPE_RBFLUSH); if (ti == NULL) { ECPTimerItem _ti; int rv; @@ -153,7 +153,7 @@ ssize_t ecp_rbuf_handle_ack(ECPConnection *conn, ecp_seq_t seq, unsigned char mt payload.buffer = pld_buf; payload.size = ECP_SIZE_PLD_BUF(0, ECP_MTYPE_NOP, conn); - ecp_pld_set_type(pld_buf, ECP_MTYPE_NOP); + ecp_pld_set_type(payload.buffer, payload.size, ECP_MTYPE_NOP); ecp_rbuf_pld_send(conn, &packet, &payload, ECP_SIZE_PLD(0, ECP_MTYPE_NOP), 0, seq_ack + i); } else { ECPBuffer packet; @@ -305,12 +305,14 @@ int ecp_rbuf_send_flush(ECPConnection *conn) { } int ecp_rbuf_pkt_prep(ECPRBSend *buf, ECPSeqItem *si, unsigned char mtype) { + int idx; + if (si->rb_pass) return ECP_OK; #ifdef ECP_WITH_PTHREAD pthread_mutex_lock(&buf->mutex); #endif - int idx = ecp_rbuf_msg_idx(&buf->rbuf, si->seq); + idx = ecp_rbuf_msg_idx(&buf->rbuf, si->seq); #ifdef ECP_WITH_PTHREAD pthread_mutex_unlock(&buf->mutex); #endif |