commit 63be947448f2ae6d0a939be08cf39c01cd907b1f from: Aleksey Ryndin date: Tue Sep 05 18:05:58 2023 UTC Send required TLS `close_notify` after sending a complete response. commit - 18938924903e63d12fb20a60b68d3566cc855944 commit + 63be947448f2ae6d0a939be08cf39c01cd907b1f blob - ccf9bf3d4371b0e68c7d7e8cb6bbcfedc2fdb0ae blob + 419f406db1ab70fb3bd5a626dfffd29d01cb498d --- vostok/transport.cc +++ vostok/transport.cc @@ -134,6 +134,16 @@ AcceptedClient::AcceptedClient(int server_socket, stru } +AcceptedClient::~AcceptedClient() +{ + if (m_is_accepted) + { + if (tls_close(get_ctx()) == -1) + error::occurred("TLS close", PrintIfError{tls_error(get_ctx())}); + } +} + + bool recv( /* in */ NotNull ctx, /* in/out */ Span &buff blob - 5533e0ea87859946aed4bfb8a63870bd800eb07a blob + 38ba5f2eaa500591a579444398b1faf73c1d001d --- vostok/transport.h +++ vostok/transport.h @@ -38,6 +38,8 @@ class AcceptedClient { public: AcceptedClient(int server_socket, struct tls *server_ctx); + ~AcceptedClient(); // Send TLS close_notify (if accepted) + bool is_accepted() const { return m_is_accepted; } struct tls *get_ctx() const { return m_ctx.get(); } @@ -81,5 +83,6 @@ send( /* in */ Span buff ); + } // namespace transport } // namespace vostok