diff options
author | Uros Majstorovic <majstor@majstor.org> | 2019-10-19 20:01:25 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2019-10-19 20:01:25 +0200 |
commit | 702f3716075528d6ad390615b5df9b79264b40bb (patch) | |
tree | c00d10a2920eeb26b15d365c191d56f4845c3b11 /code/ecp/fe310 | |
parent | 3cbb9793bf5645f400545aeef904a48fe5dca64c (diff) |
fixed transport buf free/flag set interface
Diffstat (limited to 'code/ecp/fe310')
-rw-r--r-- | code/ecp/fe310/transport.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/code/ecp/fe310/transport.c b/code/ecp/fe310/transport.c index 3493966..a0b4a05 100644 --- a/code/ecp/fe310/transport.c +++ b/code/ecp/fe310/transport.c @@ -94,19 +94,19 @@ ssize_t ecp_tr_recv(ECPSocket *sock, ECPBuffer *packet, ECPNetAddr *addr, int ti return ECP_ERR; } -void ecp_tr_buf_free(ECP2Buffer *b, unsigned char flags) { - if (b && b->packet && b->packet->buffer) { - eos_net_free(b->packet->buffer-EOS_SOCK_SIZE_UDP_HDR, flags & ECP_SEND_FLAG_MORE); - b->packet->buffer = NULL; +void ecp_tr_release(ECPBuffer *packet, unsigned char more) { + if (packet && packet->buffer) { + eos_net_free(packet->buffer-EOS_SOCK_SIZE_UDP_HDR, more); + packet->buffer = NULL; + } else if (!more) { + eos_net_release(); } } -void ecp_tr_buf_flag_set(ECP2Buffer *b, unsigned char flags) { +void ecp_tr_flag_set(unsigned char flags) { _flags |= flags; - if (flags & ECP_SEND_FLAG_MORE) ecp_tr_buf_free(b, flags); } -void ecp_tr_buf_flag_clear(ECP2Buffer *b, unsigned char flags) { +void ecp_tr_flag_clear(unsigned char flags) { _flags &= ~flags; - if (flags & ECP_SEND_FLAG_MORE) eos_net_release(); } |