summaryrefslogtreecommitdiff
path: root/mux.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2023-01-06 02:39:59 +0000
committerDamien Miller <djm@mindrot.org>2023-01-06 16:21:39 +1100
commitc60438158ad4b2f83d8504257aba1be7d0b0bb4b (patch)
tree4448c18b7d781578d8d5fc8c7335c5b7e1c1078e /mux.c
parentd478cdc7ad6edd4b1bcd1e86fb2f23194ff33d5a (diff)
downloadopenssh-git-c60438158ad4b2f83d8504257aba1be7d0b0bb4b.tar.gz
upstream: Add channel_force_close()
This will forcibly close an open channel by simulating read/write errors, draining the IO buffers and calling the detach function. Previously the detach function was only ever called during channel garbage collection, but there was no way to signal the user of a channel (e.g. session.c) that its channel was being closed deliberately (vs. by the usual state-machine logic). So this adds an extra "force" argument to the channel cleanup callback to indicate this condition. ok markus dtucker OpenBSD-Commit-ID: 23052707a42bdc62fda2508636e624afd466324b
Diffstat (limited to 'mux.c')
-rw-r--r--mux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mux.c b/mux.c
index 3cb38761..e7580ac7 100644
--- a/mux.c
+++ b/mux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mux.c,v 1.94 2022/06/03 04:30:47 djm Exp $ */
+/* $OpenBSD: mux.c,v 1.95 2023/01/06 02:39:59 djm Exp $ */
/*
* Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
*
@@ -188,7 +188,7 @@ static const struct {
/* Cleanup callback fired on closure of mux client _session_ channel */
/* ARGSUSED */
static void
-mux_master_session_cleanup_cb(struct ssh *ssh, int cid, void *unused)
+mux_master_session_cleanup_cb(struct ssh *ssh, int cid, int force, void *unused)
{
Channel *cc, *c = channel_by_id(ssh, cid);
@@ -210,7 +210,7 @@ mux_master_session_cleanup_cb(struct ssh *ssh, int cid, void *unused)
/* Cleanup callback fired on closure of mux client _control_ channel */
/* ARGSUSED */
static void
-mux_master_control_cleanup_cb(struct ssh *ssh, int cid, void *unused)
+mux_master_control_cleanup_cb(struct ssh *ssh, int cid, int force, void *unused)
{
Channel *sc, *c = channel_by_id(ssh, cid);