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 /channels.h | |
parent | d478cdc7ad6edd4b1bcd1e86fb2f23194ff33d5a (diff) |
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 'channels.h')
-rw-r--r-- | channels.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: channels.h,v 1.144 2023/01/06 02:38:23 djm Exp $ */ +/* $OpenBSD: channels.h,v 1.145 2023/01/06 02:39:59 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -88,7 +88,7 @@ typedef struct Channel Channel; struct fwd_perm_list; typedef void channel_open_fn(struct ssh *, int, int, void *); -typedef void channel_callback_fn(struct ssh *, int, void *); +typedef void channel_callback_fn(struct ssh *, int, int, void *); typedef int channel_infilter_fn(struct ssh *, struct Channel *, char *, int); typedef void channel_filter_cleanup_fn(struct ssh *, int, void *); typedef u_char *channel_outfilter_fn(struct ssh *, struct Channel *, @@ -281,6 +281,7 @@ void channel_set_fds(struct ssh *, int, int, int, int, int, void channel_free(struct ssh *, Channel *); void channel_free_all(struct ssh *); void channel_stop_listening(struct ssh *); +void channel_force_close(struct ssh *, Channel *, int); void channel_send_open(struct ssh *, int); void channel_request_start(struct ssh *, int, char *, int); |