aboutsummaryrefslogtreecommitdiff
path: root/async.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-10 18:27:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-10 18:27:17 +0000
commit629a625422615ca38732452b2a54fd59882789d4 (patch)
tree0e3248d2ae07f46886273c365c5361ae6ba0acdd /async.c
parentterminal: make the event FD used to delay shutdown non-blocking (diff)
server: be more resilient against bad behaving clients
Make both the server listening socket and the connecting client sockets non-blocking. Then, when reading the initial length of the setup packet, handle read errors from partial reads separately. Assume the client writes all four bytes of the 'length' field at once, and bail out if we are unable to read those 4 bytes. Limit the maximum setup packet size to 128K. This is to prevent clients from pretending the setup packet is insanely large, causing us to fail to malloc.
Diffstat (limited to 'async.c')
0 files changed, 0 insertions, 0 deletions