diff channel.h @ 1835:90ac15aeac43

Bring back recently removed channel->flushing This resolves the "sleep 10&echo hello" case which should return immediately
author Matt Johnston <matt@codeconstruct.com.au>
date Thu, 14 Oct 2021 20:55:15 +0800
parents a7cc3332d8ab
children 6022df862942
line wrap: on
line diff
--- a/channel.h	Tue Oct 12 23:32:10 2021 +0800
+++ b/channel.h	Thu Oct 14 20:55:15 2021 +0800
@@ -71,6 +71,9 @@
 	/* whether close/eof messages have been exchanged */
 	int sent_close, recv_close;
 	int recv_eof, sent_eof;
+	/* once flushing is set, readfd will close once no more data is available
+	(not waiting for EOF) */
+	int flushing;
 
 	struct dropbear_progress_connection *conn_pending;
 	int initconn; /* used for TCP forwarding, whether the channel has been
@@ -93,9 +96,9 @@
 	const char *name;
 	/* Sets up the channel */
 	int (*inithandler)(struct Channel*);
-	/* Called to check whether a channel should close, separately from the FD being closed.
+	/* Called to check whether a channel should close, separately from the FD being EOF.
 	Used for noticing process exiting */
-	int (*check_close)(const struct Channel*);
+	int (*check_close)(struct Channel*);
 	/* Handler for ssh_msg_channel_request */
 	void (*reqhandler)(struct Channel*);
 	/* Called prior to sending ssh_msg_channel_close, used for sending exit status */