Closed reynir closed 3 years ago
I think it would be better if we close the connection to the misbehaving client. We could then either return `Eof
or extend the signature with an error variant `Error of string
. The latter would be a breaking change, but I think it's preferable to signal an error occured. What do you think?
I'm in favour of what you propose: do not raise an exception, but instead return an error and close the connection.
I noticed that
RExec.read_raw
and thus indirectlyRExec.read
andRExec.read_line
raise an exception throughLwt.fail
if the client sends an unexpected message type. This behavior is undocumented, and I think it's perhaps more reasonable to close the connection to the misbehaving client like I implemented here for the client https://github.com/reynir/mirage-qubes/pull/1/commits/ee21564dd3a545751a77387de6ae707333e70ce2https://github.com/mirage/mirage-qubes/blob/master/lib/rExec.ml#L92