mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-05-06 06:47:17 -04: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);
|
assert(events & EPOLLIN);
|
||||||
|
|
||||||
|
if (client->term != NULL) {
|
||||||
|
uint8_t dummy[128];
|
||||||
|
read(fd, dummy, sizeof(dummy));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t term_env_len;
|
uint16_t term_env_len;
|
||||||
if (recv(fd, &term_env_len, sizeof(term_env_len), 0) != sizeof(term_env_len))
|
if (recv(fd, &term_env_len, sizeof(term_env_len), 0) != sizeof(term_env_len))
|
||||||
goto shutdown;
|
goto shutdown;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue