From c60438158ad4b2f83d8504257aba1be7d0b0bb4b Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Fri, 6 Jan 2023 02:39:59 +0000 Subject: 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 --- session.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'session.h') diff --git a/session.h b/session.h index ce59dabd..344a1ddf 100644 --- a/session.h +++ b/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.36 2018/10/02 12:40:07 djm Exp $ */ +/* $OpenBSD: session.h,v 1.37 2023/01/06 02:39:59 djm Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -70,7 +70,7 @@ int session_open(Authctxt *, int); void session_unused(int); int session_input_channel_req(struct ssh *, Channel *, const char *); void session_close_by_pid(struct ssh *ssh, pid_t, int); -void session_close_by_channel(struct ssh *, int, void *); +void session_close_by_channel(struct ssh *, int, int, void *); void session_destroy_all(struct ssh *, void (*)(Session *)); void session_pty_cleanup2(Session *); -- cgit v1.2.1