diff options
author | Thomas Adam <thomas@xteddy.org> | 2023-01-06 09:02:00 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2023-01-06 09:02:00 +0000 |
commit | 21e00e46359478f95c15f1672e5796e86eb0f529 (patch) | |
tree | 12e23d6fe45d82cdd73373d3b3566bada6fce4f2 /window.c | |
parent | 70ff8cfe1e06987501a55a32df31d1f69acd2f99 (diff) | |
parent | 09afc6c8ee971918d925c441c41a9de7f598efb7 (diff) | |
download | rtmux-21e00e46359478f95c15f1672e5796e86eb0f529.tar.gz rtmux-21e00e46359478f95c15f1672e5796e86eb0f529.tar.bz2 rtmux-21e00e46359478f95c15f1672e5796e86eb0f529.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -64,6 +64,7 @@ static u_int next_active_point; struct window_pane_input_data { struct cmdq_item *item; u_int wp; + struct client_file *file; }; static struct window_pane *window_pane_create(struct window *, u_int, u_int, @@ -1543,18 +1544,16 @@ window_pane_input_callback(struct client *c, __unused const char *path, size_t len = EVBUFFER_LENGTH(buffer); wp = window_pane_find_by_id(cdata->wp); - if (wp == NULL || closed || error != 0 || (c->flags & CLIENT_DEAD)) { + if (cdata->file != NULL && (wp == NULL || c->flags & CLIENT_DEAD)) { if (wp == NULL) c->flags |= CLIENT_EXIT; - - evbuffer_drain(buffer, len); + file_cancel(cdata->file); + } else if (cdata->file == NULL || closed || error != 0) { cmdq_continue(cdata->item); - server_client_unref(c); free(cdata); - return; - } - input_parse_buffer(wp, buf, len); + } else + input_parse_buffer(wp, buf, len); evbuffer_drain(buffer, len); } @@ -1577,9 +1576,8 @@ window_pane_start_input(struct window_pane *wp, struct cmdq_item *item, cdata = xmalloc(sizeof *cdata); cdata->item = item; cdata->wp = wp->id; - + cdata->file = file_read(c, "-", window_pane_input_callback, cdata); c->references++; - file_read(c, "-", window_pane_input_callback, cdata); return (0); } |