You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by is...@apache.org on 2021/06/27 19:55:45 UTC

[ignite] branch master updated: IGNITE-15006 Fix SSL read error

This is an automated email from the ASF dual-hosted git repository.

isapego pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new ff7e0b8  IGNITE-15006 Fix SSL read error
ff7e0b8 is described below

commit ff7e0b84c6d143606fa553494207bec1f6717ca9
Author: Igor Sapego <is...@apache.org>
AuthorDate: Sun Jun 27 22:54:17 2021 +0300

    IGNITE-15006 Fix SSL read error
---
 .../network/src/network/ssl/secure_socket_client.cpp | 20 +++++++++++++++++++-
 modules/platforms/cpp/odbc/src/connection.cpp        |  3 ++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/modules/platforms/cpp/network/src/network/ssl/secure_socket_client.cpp b/modules/platforms/cpp/network/src/network/ssl/secure_socket_client.cpp
index 6dd57d4..9e4143d 100644
--- a/modules/platforms/cpp/network/src/network/ssl/secure_socket_client.cpp
+++ b/modules/platforms/cpp/network/src/network/ssl/secure_socket_client.cpp
@@ -171,7 +171,25 @@ namespace ignite
                         return res;
                 }
 
-                return sslGateway.SSL_read_(ssl0, buffer, static_cast<int>(size));
+                do {
+                    res = sslGateway.SSL_read_(ssl0, buffer, static_cast<int>(size));
+
+                    if (res <= 0)
+                    {
+                        int err = sslGateway.SSL_get_error_(ssl0, res);
+                        if (IsActualError(err))
+                            return -err;
+
+                        int want = sslGateway.SSL_want_(ssl0);
+
+                        int waitRes = WaitOnSocket(ssl, timeout, want == SSL_READING);
+
+                        if (waitRes < 0 || waitRes == WaitResult::TIMEOUT)
+                            return waitRes;
+                    }
+                } while (res <= 0);
+
+                return res;
             }
 
             bool SecureSocketClient::IsBlocking() const
diff --git a/modules/platforms/cpp/odbc/src/connection.cpp b/modules/platforms/cpp/odbc/src/connection.cpp
index b073580..a747063 100644
--- a/modules/platforms/cpp/odbc/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/src/connection.cpp
@@ -85,7 +85,8 @@ namespace ignite
                 << config::ConnectionInfo::InfoTypeToString(type) << "), "
                 << std::hex << reinterpret_cast<size_t>(buf) << ", "
                 << buflen << ", "
-                << std::hex << reinterpret_cast<size_t>(reslen));
+                << std::hex << reinterpret_cast<size_t>(reslen)
+                << std::dec);
 
             IGNITE_ODBC_API_CALL(InternalGetInfo(type, buf, buflen, reslen));
         }