ivandasch commented on a change in pull request #9773:
URL: https://github.com/apache/ignite/pull/9773#discussion_r793308835
##########
File path: modules/platforms/cpp/common/src/common/utils.cpp
##########
@@ -229,5 +231,46 @@ namespace ignite
return dump.str();
}
+ void ThrowSystemError(const std::string &msg)
+ {
+ throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, msg.c_str());
+ }
+
+ void ThrowLastSystemError(const std::string& description, const
std::string& advice)
+ {
+ ThrowSystemError(GetLastSystemError(description, advice));
+ }
+
+ void ThrowLastSystemError(const std::string& description)
+ {
+ std::string empty;
+ ThrowLastSystemError(description, empty);
+ }
+
+ std::string FormatErrorMessage(const std::string &description, const
std::string &details,
+ const std::string &advice)
+ {
+ std::stringstream messageBuilder;
+ messageBuilder << description;
+ if (!details.empty())
+ messageBuilder << ": " << details;
+
+ if (!advice.empty())
+ messageBuilder << ". " << advice;
+
+ return messageBuilder.str();
+ }
+
+ std::string GetLastSystemError(const std::string& description, const
std::string& advice)
+ {
+ return common::FormatErrorMessage(description,
GetLastSystemError(), advice);
Review comment:
Namespace prefix is not needed here, may be it is worth to remove it?
##########
File path:
modules/platforms/cpp/network/os/linux/src/network/linux_async_worker_thread.h
##########
@@ -135,13 +135,6 @@ namespace ignite
*/
bool ShouldInitiateNewConnection() const;
- /**
Review comment:
`void StartMonitoringFd` is not defined, but declared
##########
File path: modules/platforms/cpp/network/src/network/ssl/ssl_gateway.h
##########
@@ -174,7 +173,7 @@ namespace ignite
int SSL_pending_(const SSL* ssl);
- int SSL_is_init_finished_(const SSL* ssl);
+ const char* SSL_get_version_(const SSL* ssl);
Review comment:
This method is not defined
##########
File path:
modules/platforms/cpp/network/os/linux/src/network/linux_async_client_pool.cpp
##########
@@ -112,7 +110,16 @@ namespace ignite
bool closed = client.Get()->Close();
if (closed)
+ {
+ IgniteError err0(client.Get()->GetCloseError());
Review comment:
In worst case it is possible to create 2 instance of Ignite error with 2
new char array allocation and 1 deallocation.
##########
File path: modules/platforms/cpp/network/src/network/ssl/ssl_gateway.cpp
##########
@@ -218,9 +220,7 @@ namespace ignite
functions.fpSSL_write = LoadSslMethod("SSL_write");
functions.fpSSL_read = LoadSslMethod("SSL_read");
functions.fpSSL_pending = LoadSslMethod("SSL_pending");
- functions.fpSSL_get_state = TryLoadSslMethod("SSL_get_state");
- if (!functions.fpSSL_get_state)
- functions.fpSSL_get_state = LoadSslMethod("SSL_state");
+ functions.fpSSL_get_version = LoadSslMethod("SSL_get_version");
Review comment:
`fpSSL_get_version` -- is not used. May be it is worth to create handy
method in `SslGateway`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]