Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion include/ylt/coro_io/server_acceptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,12 @@ struct tcp_server_acceptor : public server_acceptor_base {
auto error = co_await coro_io::async_accept(*acceptor_, socket);
ELOG_TRACE << "get connection from acceptor: " << address_ << ":" << port_;
if (error) {
ELOG_ERROR << "accept error: " << error.message();
if (error == asio::error::operation_aborted) {
ELOG_INFO << "accept canceled by server quit: " << error.message();
}
else {
ELOG_ERROR << "accept error: " << error.message();
}
if (error == asio::error::operation_aborted ||
error == asio::error::bad_descriptor) {
acceptor_close_waiter_.set_value();
Expand Down
2 changes: 2 additions & 0 deletions include/ylt/coro_rpc/impl/common_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ inline bool init_ssl_context_helper(asio::ssl::context &context,

// Set lower security level for test certificates (OpenSSL 3.0
// compatibility)
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
SSL_CTX_set_security_level(context.native_handle(), 0);
#endif

// Load CA certificate for client verification if provided
asio::error_code ec;
Expand Down
2 changes: 2 additions & 0 deletions include/ylt/coro_rpc/impl/coro_rpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ class coro_rpc_client {

// Set lower security level for test certificates (OpenSSL 3.0
// compatibility)
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
SSL_CTX_set_security_level(ssl_ctx_.native_handle(), 0);
#endif

if (file_exists(cert_file)) {
ELOG_INFO << "load " << cert_file.string();
Expand Down
10 changes: 8 additions & 2 deletions include/ylt/coro_rpc/impl/coro_rpc_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,14 @@ class coro_rpc_server_base {
p.setValue(errc_);
}
else {
ELOG_ERROR << "server quit with error: " << res.value().message();
p.setValue(res.value());
auto &value = res.value();
if (value.ec == coro_rpc::errc::operation_canceled) {
ELOG_INFO << "server quit: " << value.message();
}
else {
ELOG_ERROR << "server quit with error: " << value.message();
}
p.setValue(value);
}
});
return future;
Expand Down
4 changes: 4 additions & 0 deletions include/ylt/standalone/cinatra/coro_http_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ class coro_http_connection
ssl_ctx_->set_options(ssl_options);
// Set lower security level for test certificates (OpenSSL 3.0
// compatibility)
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
SSL_CTX_set_security_level(ssl_ctx_->native_handle(), 0);
#endif

if (!passwd.empty()) {
ssl_ctx_->set_password_callback([pwd = std::move(passwd)](auto, auto) {
Expand Down Expand Up @@ -128,7 +130,9 @@ class coro_http_connection
ssl_ctx_->set_options(ssl_options);
// Set lower security level for test certificates (OpenSSL 3.0
// compatibility)
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
SSL_CTX_set_security_level(ssl_ctx_->native_handle(), 0);
#endif

if (!passwd.empty()) {
ssl_ctx_->set_password_callback([pwd = std::move(passwd)](auto, auto) {
Expand Down
Loading