summaryrefslogtreecommitdiffstats
path: root/src/protocol.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 08:14:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 08:14:56 +0000
commit62010aafd4014c19d4d0cf36f01d3c53b43c5e7b (patch)
tree6f1fd3cfe312292e359bb7befa4b44a5fe986182 /src/protocol.c
parentReleasing debian version 1.7.3-2. (diff)
downloadttyd-62010aafd4014c19d4d0cf36f01d3c53b43c5e7b.tar.xz
ttyd-62010aafd4014c19d4d0cf36f01d3c53b43c5e7b.zip
Merging upstream version 1.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/protocol.c')
-rw-r--r--src/protocol.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocol.c b/src/protocol.c
index cc0945b..53e65d4 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -306,7 +306,7 @@ int callback_tty(struct lws *wsi, enum lws_callback_reasons reason, void *user,
switch (command) {
case INPUT:
- if (server->readonly) break;
+ if (!server->writable) break;
int err = pty_write(pss->process, pty_buf_init(pss->buffer + 1, pss->len - 1));
if (err) {
lwsl_err("uv_write: %s (%s)\n", uv_err_name(err), uv_strerror(err));
@@ -379,8 +379,8 @@ int callback_tty(struct lws *wsi, enum lws_callback_reasons reason, void *user,
}
}
- if (server->once && server->client_count == 0) {
- lwsl_notice("exiting due to the --once option.\n");
+ if ((server->once || server->exit_no_conn) && server->client_count == 0) {
+ lwsl_notice("exiting due to the --once/--exit-no-conn option.\n");
force_exit = true;
lws_cancel_service(context);
exit(0);