Get the latest tech news

Pipelined State Machine Corruption


state machine corruption There are a number of network protocols that we might refer to as text protocols, where we send a line of text to the server and it sends back a response. Perhaps I should call them CRLF protocols, to distinguish from protocols where we’re blasting JSON back and forth.

In my mind, a simple server, unaware of pipelining, will read one request at a time, process it, and send the reply. It would of course be better, and correct, to remember more specifically where we are in the connection, but I can imagine assuming that if commands arrive one at a time, we can save a byte and rely on the ready descriptor to guide us through the state machine. You can’t forget to read while you’re sending all these requests, or the server might get stuck with all the responses that don’t fit in the pipe coming back.

Get the Android app

Or read this on Hacker News