Add support for the --readonly option

This commit is contained in:
Shuanglei Tao
2016-10-10 22:08:17 +08:00
parent 3c9884a87b
commit 67d6564cfb
4 changed files with 12 additions and 1 deletions

View File

@@ -258,6 +258,8 @@ callback_tty(struct lws *wsi, enum lws_callback_reasons reason,
switch (command) {
case INPUT:
if (server->readonly)
return 0;
if (write(client->pty, client->buffer + 1, client->len - 1) < client->len - 1) {
lwsl_err("write INPUT to pty\n");
return -1;