mirror of
https://github.com/tmux/tmux.git
synced 2026-10-08 02:34:28 +00:00
Do not let a stuck client prevent the server from exiting - give up
after 10 seconds. GitHub issue 5444 from Ben Maurer.
This commit is contained in:
19
control.c
19
control.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: control.c,v 1.63 2026/08/03 13:38:42 nicm Exp $ */
|
||||
/* $OpenBSD: control.c,v 1.64 2026/08/03 20:18:20 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -968,6 +968,23 @@ control_discard(struct client *c)
|
||||
bufferevent_disable(cs->read_event, EV_READ);
|
||||
}
|
||||
|
||||
/*
|
||||
* Discard all output for a client, including output which has already been
|
||||
* queued to be written.
|
||||
*/
|
||||
void
|
||||
control_discard_all(struct client *c)
|
||||
{
|
||||
struct control_state *cs = c->control_state;
|
||||
struct control_block *cb, *cb1;
|
||||
struct evbuffer *evb = cs->write_event->output;
|
||||
|
||||
control_discard(c);
|
||||
TAILQ_FOREACH_SAFE(cb, &cs->all_blocks, all_entry, cb1)
|
||||
control_free_block(cs, cb);
|
||||
evbuffer_drain(evb, EVBUFFER_LENGTH(evb));
|
||||
}
|
||||
|
||||
/* Stop control mode. */
|
||||
void
|
||||
control_stop(struct client *c)
|
||||
|
||||
Reference in New Issue
Block a user