Improved SSL_R_SHORT_READ check

This commit is contained in:
eidheim 2022-08-16 10:58:59 +02:00
commit 88569844ea
2 changed files with 12 additions and 4 deletions

View file

@ -57,6 +57,11 @@ namespace SimpleWeb {
protected:
asio::ssl::context context;
/// Ignore for end of file and SSL_R_SHORT_READ error codes
error_code clean_error_code(const error_code &ec) override {
return ec == error::eof || ec == asio::ssl::error::stream_truncated ? error_code() : ec;
}
std::shared_ptr<Connection> create_connection() noexcept override {
return std::make_shared<Connection>(handler_runner, *io_service, context);
}