diff options
author | Uros Majstorovic <majstor@majstor.org> | 2018-03-21 05:57:15 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2018-03-21 05:57:15 +0100 |
commit | 5afe15b354c2b7818924110f0a2d580f0f970001 (patch) | |
tree | bd5dcc4c74bc831971420dcf7015700c24c8e6a0 /code/ecp/rbuf_recv.c | |
parent | 6c7ac8ffd4f21a159438959cb365c7caa279e149 (diff) |
rbuf code refactor
Diffstat (limited to 'code/ecp/rbuf_recv.c')
-rw-r--r-- | code/ecp/rbuf_recv.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/code/ecp/rbuf_recv.c b/code/ecp/rbuf_recv.c index 6ebfc64..4bd76cc 100644 --- a/code/ecp/rbuf_recv.c +++ b/code/ecp/rbuf_recv.c @@ -245,24 +245,6 @@ void ecp_rbuf_recv_destroy(ECPConnection *conn) { conn->rbuf.recv = NULL; } -int ecp_rbuf_recv_set_hole(ECPConnection *conn, unsigned short hole_max) { - ECPRBRecv *buf = conn->rbuf.recv; - - buf->hole_max = hole_max; - buf->hole_mask_full = ~(~((ecp_ack_t)1) << (hole_max * 2)); - buf->hole_mask_empty = ~(~((ecp_ack_t)1) << (hole_max + 1)); - - return ECP_OK; -} - -int ecp_rbuf_recv_set_delay(ECPConnection *conn, ecp_pts_t delay) { - ECPRBRecv *buf = conn->rbuf.recv; - - buf->deliver_delay = delay; - - return ECP_OK; -} - int ecp_rbuf_recv_start(ECPConnection *conn, ecp_seq_t seq) { int rv; ECPRBRecv *buf = conn->rbuf.recv; @@ -284,6 +266,24 @@ int ecp_rbuf_recv_start(ECPConnection *conn, ecp_seq_t seq) { return ECP_OK; } +int ecp_rbuf_recv_set_hole(ECPConnection *conn, unsigned short hole_max) { + ECPRBRecv *buf = conn->rbuf.recv; + + buf->hole_max = hole_max; + buf->hole_mask_full = ~(~((ecp_ack_t)1) << (hole_max * 2)); + buf->hole_mask_empty = ~(~((ecp_ack_t)1) << (hole_max + 1)); + + return ECP_OK; +} + +int ecp_rbuf_recv_set_delay(ECPConnection *conn, ecp_pts_t delay) { + ECPRBRecv *buf = conn->rbuf.recv; + + buf->deliver_delay = delay; + + return ECP_OK; +} + ssize_t ecp_rbuf_recv_store(ECPConnection *conn, ecp_seq_t seq, unsigned char *msg, size_t msg_size, ECP2Buffer *b) { ECPRBRecv *buf = conn->rbuf.recv; ecp_seq_t ack_pkt = 0; |