diff options
author | Uros Majstorovic <majstor@majstor.org> | 2017-08-19 19:16:18 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2017-08-19 19:16:18 +0200 |
commit | 050bf97c2dc6c22e7b3134e281ee892e5351439f (patch) | |
tree | dc44faa97f20c03bc0d3dd6d0a1e4d121c9562dd /code/core/rbuf_recv.c | |
parent | 5d20e9bafc3571f37eb0d9b74699d023d2d3d13a (diff) |
timer improved; rbuf finally implemented
Diffstat (limited to 'code/core/rbuf_recv.c')
-rw-r--r-- | code/core/rbuf_recv.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/code/core/rbuf_recv.c b/code/core/rbuf_recv.c index d78ffce..e73c602 100644 --- a/code/core/rbuf_recv.c +++ b/code/core/rbuf_recv.c @@ -221,11 +221,14 @@ ssize_t ecp_rbuf_recv_store(ECPConnection *conn, ecp_seq_t seq, unsigned char *m ecp_seq_t ack_pkt = 0; ssize_t rv; int do_ack = 0; + unsigned char mtype; if (buf == NULL) return ECP_ERR; if (msg_size < 1) return ECP_ERR_MIN_MSG; - // XXX mtype == RBACK | RBFLUSH handle imediately + mtype = msg[0] & ECP_MTYPE_MASK; + if ((mtype == ECP_MTYPE_RBACK) || (mtype == ECP_MTYPE_RBFLUSH)) return ecp_msg_handle(conn, seq, msg, msg_size); + if (ECP_RBUF_SEQ_LT(buf->rbuf.seq_max, seq)) ack_pkt = seq - buf->rbuf.seq_max; if (ECP_RBUF_SEQ_LTE(seq, buf->seq_ack)) { ecp_seq_t seq_offset = buf->seq_ack - seq; |