From ec9066167bf1f53ca6b1a23d1ff3d7d5cf4e7333 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 23 Aug 2020 00:39:39 -0500 Subject: [PATCH] Stop flow before sending last I frame in window Stop flow before sending last I frame in window; furthermore, this last I frame will have the P/F flag set to 1, to implicitly request a RR, RNR or REJ response as appropriate --- src/server.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/server.c b/src/server.c index 32bc4eb..d2d2a99 100644 --- a/src/server.c +++ b/src/server.c @@ -2204,22 +2204,17 @@ static int handle_sock(uint32_t key, return 0; } + if (sock->flow == PATTY_AX25_SOCK_WAIT) { + sock->flow = PATTY_AX25_SOCK_READY; + } + /* * AX.25 v2.2, Section 6.4.1 "Sending I Frames" */ - if (sock->flow == PATTY_AX25_SOCK_WAIT) { - sock->flow = PATTY_AX25_SOCK_READY; - } else if (patty_ax25_sock_flow_full(sock)) { - int ret; - + if (patty_ax25_sock_flow_left(sock) == 1) { sock_flow_stop(server, sock); - ret = patty_ax25_sock_send_rr(sock, PATTY_AX25_FRAME_COMMAND, 1); - patty_timer_stop(&sock->timer_t3); - patty_timer_start(&sock->timer_t1); - - return ret; } /*