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,