Previously it was possible for a client to send a Data payload after a Shutdown or Close which would break the Go multiplexer's main loop, because it would get EOF from io.CopyN. This PR handles this error by discarding the unexpected data and processing the next message.
To make the code clearer this PR also
removes unnecessary error cases from the Go code
creates helper predicates is_read_eof and is_write_eof in the OCaml code.
Previously it was possible for a client to send a
Data
payload after aShutdown
orClose
which would break the Go multiplexer's main loop, because it would getEOF
fromio.CopyN
. This PR handles this error by discarding the unexpected data and processing the next message.To make the code clearer this PR also
error
cases from the Go codeis_read_eof
andis_write_eof
in the OCaml code.