]> prime8.dev >> repos - ttyd.git/commit
protocol: fix readonly handling (#373)
authorGirts <girtsf@users.noreply.github.com>
Sat, 6 Jun 2020 13:51:15 +0000 (06:51 -0700)
committerGitHub <noreply@github.com>
Sat, 6 Jun 2020 13:51:15 +0000 (21:51 +0800)
commit56d26accd325265e4f9350ea080096f5fc9e01c6
tree11a9838db4a42677d37f2e5c3dedfef1cf996ff2
parent3950bdc2f4f08bd9807347b5fe95e1c023e25d2a
protocol: fix readonly handling (#373)

Previously, if running in readonly mode (`-R`), we would keep
accumulating incoming websocket data to `pss->buffer`, resizing it with
every incoming message. This would also break the `RESIZE` operation as
we would never get rid of the `INPUT` message.

Now we discard `INPUT` messages in `readonly` mode, 1) allowing resize
to work and 2) preventing the buffer from growing indefinitely.
src/protocol.c