=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/packet.c,v retrieving revision 1.311 retrieving revision 1.312 diff -u -r1.311 -r1.312 --- src/usr.bin/ssh/packet.c 2023/08/28 03:28:43 1.311 +++ src/usr.bin/ssh/packet.c 2023/08/28 03:31:16 1.312 @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.311 2023/08/28 03:28:43 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.312 2023/08/28 03:31:16 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2058,6 +2058,18 @@ return sshbuf_len(ssh->state->output) < 16384; else return sshbuf_len(ssh->state->output) < 128 * 1024; +} + +/* + * returns true when there are at most a few keystrokes of data to write + * and the connection is in interactive mode. + */ + +int +ssh_packet_interactive_data_to_write(struct ssh *ssh) +{ + return ssh->state->interactive_mode && + sshbuf_len(ssh->state->output) < 256; } void