chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.98k stars 1.22k forks source link

Handling of `error::eof` in `ssl::stream::shutdown(ec)` #1483

Open ashtum opened 6 months ago

ashtum commented 6 months ago

It seems that the eof error in the ssl::stream::async_shutdown operation is ignored, which is expected as eof errors for unsuccessful shutdown operations map to stream_truncated: https://github.com/chriskohlhoff/asio/blob/master/asio/include/asio/ssl/detail/shutdown_op.hpp#L49 However, I couldn't find the same treatment in the synchronous version of that function, ssl::stream::shutdown().

I should mention that I couldn't reproduce a condition where ssl::stream::shutdown(ec) completes with an eof error. I'm merely speculating based on the code.