chriskohlhoff / asio

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

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

Open ashtum opened 1 month ago

ashtum commented 1 month 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.