From 826653f0d9b11342c8dd20b9b7a17abfbb1a561d Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 23 Aug 2020 00:37:13 -0500 Subject: [PATCH] Remove unused patty_ax25_sock_flow_full() Remove unused patty_ax25_sock_flow_full(), in favor of the previously implemented patty_ax25_sock_flow_left(), as a better means of determining what flow control measures to take and how to interrogate the peer for readiness to receive with minimal overhead --- include/patty/ax25/sock.h | 2 -- src/sock.c | 14 +++++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/patty/ax25/sock.h b/include/patty/ax25/sock.h index 13351c0..129e866 100644 --- a/include/patty/ax25/sock.h +++ b/include/patty/ax25/sock.h @@ -202,8 +202,6 @@ void patty_ax25_sock_vr_incr(patty_ax25_sock *sock); int patty_ax25_sock_flow_left(patty_ax25_sock *sock); -int patty_ax25_sock_flow_full(patty_ax25_sock *sock); - /* * Frame segment reassembly state machine */ diff --git a/src/sock.c b/src/sock.c index 6661ebf..e32d152 100644 --- a/src/sock.c +++ b/src/sock.c @@ -536,14 +536,6 @@ void *patty_ax25_sock_assembler_read(patty_ax25_sock *sock, } int patty_ax25_sock_flow_left(patty_ax25_sock *sock) { - if (sock->n_window_tx == 1) { - return 1; - } - - return sock->vs - tx_seq(sock, sock->va + sock->n_window_tx); -} - -int patty_ax25_sock_flow_full(patty_ax25_sock *sock) { /* * 6.4.1 Sending I Frames * @@ -552,7 +544,11 @@ int patty_ax25_sock_flow_full(patty_ax25_sock *sock) { * k. If the TNC sent more I frames, the flow control window would be * exceeded and errors could result. */ - return sock->vs == tx_seq(sock, sock->va + sock->n_window_tx)? 1: 0; + if (sock->n_window_tx == 1) { + return 1; + } + + return sock->vs - tx_seq(sock, sock->va + sock->n_window_tx); } static inline int toobig(patty_ax25_sock *sock,