moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.1k stars 187 forks source link

mux: ocaml: avoid sending Shutdown after Close #458

Closed djs55 closed 5 years ago

djs55 commented 5 years ago

A badly-behaved client could send Shutdown after Close, for example if the Proxy.proxy function in vpnkit throws an exception for one of the directions, the function will return and the Lwt.finalize will call close. Some time later the other copy will finish and call close_write which will send a Shutdown message.

This PR avoids sending Shutdown messages after Close. We already covered the case of sending Data or Close messages after Close.