mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
server: workaround evil clients
If the clients attempt to send more data after we've instantiated the terminal, just consume the data but ignore it.
This commit is contained in:
parent
5f77f0e999
commit
5b3fe4492c
1 changed files with 6 additions and 0 deletions
6
server.c
6
server.c
|
|
@ -102,6 +102,12 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
|
|||
|
||||
assert(events & EPOLLIN);
|
||||
|
||||
if (client->term != NULL) {
|
||||
uint8_t dummy[128];
|
||||
read(fd, dummy, sizeof(dummy));
|
||||
return true;
|
||||
}
|
||||
|
||||
uint16_t term_env_len;
|
||||
if (recv(fd, &term_env_len, sizeof(term_env_len), 0) != sizeof(term_env_len))
|
||||
goto shutdown;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue