From 702f3716075528d6ad390615b5df9b79264b40bb Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sat, 19 Oct 2019 20:01:25 +0200 Subject: fixed transport buf free/flag set interface --- code/ecp/fe310/transport.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'code/ecp/fe310') 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(); } -- cgit v1.2.3