diff options
author | djm@openbsd.org <djm@openbsd.org> | 2023-01-06 02:39:59 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2023-01-06 16:21:39 +1100 |
commit | c60438158ad4b2f83d8504257aba1be7d0b0bb4b (patch) | |
tree | 4448c18b7d781578d8d5fc8c7335c5b7e1c1078e /mux.c | |
parent | d478cdc7ad6edd4b1bcd1e86fb2f23194ff33d5a (diff) | |
download | openssh-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |