Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/41#discussion_r98476667
--- Diff: libminifi/src/Site2SitePeer.cpp ---
@@ -237,12 +271,31 @@ int Site2SitePeer::readData(uint8_t *buf, int buflen,
CRC32 *crc)
Close();
return status;
}
- status = recv(_socket, buf, buflen, 0);
- if (status <= 0)
+ if (!_ssl)
{
- Close();
- // this->yield();
- return status;
+ status = recv(_socket, buf, buflen, 0);
+ if (status <= 0)
+ {
+ Close();
+ // this->yield();
+ return status;
+ }
+ }
+ else
+ {
+ // for SSL, wait for the TLS IO is completed
+ int sslStatus;
+ do {
+ status = SSL_read(_ssl, buf, buflen);
+ sslStatus = SSL_get_error(_ssl, status);
+ }
+ while (status < 0 && sslStatus == SSL_ERROR_WANT_READ);
+ if (status <= 0)
+ {
+ Close();
+ // this->yield();
--- End diff --
should this be removed?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---