[asio-users] Handle interruptions while performing sync handshake on TLS sockets
Brought to you by:
chris_kohlhoff
From: Amirsaman M. <ami...@mo...> - 2025-01-14 20:10:14
|
Hi there, My understanding from the code is that the public-facing API <https://github.com/chriskohlhoff/asio/blob/62481a25be6cf78cbe714419a4462fd89bd84ab9/asio/include/asio/ssl/stream.hpp#L406-L421> does not allow continuing interrupted handshakes, since the API doesn't inform the caller about the number of transferred bytes during the latest interrupted attempt. The implementation for `detail::handshake_op` supports retrying and advancing buffers, but it doesn't handle interrupted syscalls and delegates those to the caller. However, the caller cannot simply retry the handshake as consumed bytes off the wire are no longer available. Am I missing something or the caller is expected to drop the connection? -- *{* name : "Amirsaman Memaripour", title : "Staff Engineer", location : "New York, NY", twitter : "@MongoDB <https://www.google.com/url?q=https%3A%2F%2Ftwitter.com%2Fmongodb&sa=D&sntz=1&usg=AFQjCNGEAIAhZyZhF7Z9ORWsRliTuc-2dg> ", facebook : "MongoDB <https://www.google.com/url?q=https%3A%2F%2Fwww.facebook.com%2Fmongodb&sa=D&sntz=1&usg=AFQjCNGPMcaFBzmWsh-MpaWeTH6vMQoDIg> " *}* |