about summary refs log tree commit diff stats
path: root/src/layout
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-12 22:53:49 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-12 23:04:47 +0100
commit64e6debefbc2ab00735b83ae1def168775006844 (patch)
tree0262e1b875c05ca453885bde0b24281047f87e4d /src/layout
parent2a8f0e7061babf03bc614554e3d5fd32220c305c (diff)
downloadchawan-64e6debefbc2ab00735b83ae1def168775006844.tar.gz
client: fix blocking reads on container connection
Sometimes, headers take a while to reach us even after the result has
been sent. e.g.

echo 'Cha-Control: Connected'
sleep 5
echo 'Cha-Control: ControlDone'

^ this froze the UI for 5 seconds, that's certainly not what we want.

Since we don't have a proper buffered reader yet, and I don't want to
write another disgusting hack like BufStream, we just use a state
machine to figure out how much we can read. Sounds bad, but in practice
it works just fine since loader's response patterns are very simple.
Diffstat (limited to 'src/layout')
0 files changed, 0 insertions, 0 deletions