From 87ff9a1a5639d5ceab2c9eb474a31126c50a3033 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 11 Oct 2021 15:42:14 +0800 Subject: Replace ChanType.sepfds with Channel.bidir_fd This handles the case where a svrchansess has separate FDs for nopty, but a single FD for pty mode. The use of sepfds was also previously incorrect for X11 and agent forwarding --- channel.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'channel.h') diff --git a/channel.h b/channel.h index 4c6fe54..6aae9ea 100644 --- a/channel.h +++ b/channel.h @@ -60,6 +60,9 @@ struct Channel { int readfd; /* read from insecure side, written to wire */ int errfd; /* used like writefd or readfd, depending if it's client or server. Doesn't exactly belong here, but is cleaner here */ + int bidir_fd; /* a boolean indicating that writefd/readfd are the same + file descriptor (bidirectional), such as a network socket or PTY. + That is handled differently when closing FDs */ circbuffer *writebuf; /* data from the wire, for local consumption. Can be initially NULL */ circbuffer *extrabuf; /* extended-data for the program - used like writebuf @@ -87,7 +90,6 @@ struct Channel { struct ChanType { - int sepfds; /* Whether this channel has separate pipes for in/out or not */ const char *name; /* Sets up the channel */ int (*inithandler)(struct Channel*); -- cgit v1.2.1