Only set P/F flag on I frames when window is hit
Changes: * In src/sock.c, inline function control_i(), only set the P/F flag when the window of the peer has just received up to its window
This commit is contained in:
parent
b619fffb32
commit
c6af57b245
1 changed files with 10 additions and 4 deletions
14
src/sock.c
14
src/sock.c
|
@ -643,7 +643,13 @@ error_invalid_type:
|
|||
return -1;
|
||||
}
|
||||
|
||||
static inline uint16_t control_i(patty_ax25_sock *sock, int ns, int flag) {
|
||||
static inline uint16_t control_i(patty_ax25_sock *sock, int ns) {
|
||||
int flag = 0;
|
||||
|
||||
if (sock->vs == tx_seq(sock, sock->va + sock->n_window_tx - 1)) {
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
switch (sock->mode) {
|
||||
case PATTY_AX25_SOCK_SABM:
|
||||
return ((sock->vr & 0x07) << 5)
|
||||
|
@ -752,7 +758,7 @@ ssize_t patty_ax25_sock_resend(patty_ax25_sock *sock, int seq) {
|
|||
|
||||
return slot->len > 0? frame_send(sock,
|
||||
PATTY_AX25_FRAME_COMMAND,
|
||||
control_i(sock, seq, 0),
|
||||
control_i(sock, seq),
|
||||
sock->proto,
|
||||
slot + 1,
|
||||
slot->len): 0;
|
||||
|
@ -980,7 +986,7 @@ static ssize_t write_segmented(patty_ax25_sock *sock,
|
|||
size_t o = 0;
|
||||
|
||||
uint16_t control = sock->type == PATTY_AX25_SOCK_STREAM?
|
||||
control_i(sock, sock->vs, 0):
|
||||
control_i(sock, sock->vs):
|
||||
control_ui(0);
|
||||
|
||||
if (first) {
|
||||
|
@ -1042,7 +1048,7 @@ ssize_t patty_ax25_sock_write(patty_ax25_sock *sock,
|
|||
|
||||
if (frame_send(sock,
|
||||
PATTY_AX25_FRAME_COMMAND,
|
||||
control_i(sock, sock->vs, 0),
|
||||
control_i(sock, sock->vs),
|
||||
sock->proto,
|
||||
buf,
|
||||
len) < 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue