fgerlits commented on a change in pull request #959:
URL: https://github.com/apache/nifi-minifi-cpp/pull/959#discussion_r542574442



##########
File path: libminifi/src/io/tls/TLSServerSocket.cpp
##########
@@ -87,13 +87,13 @@ void 
TLSServerSocket::registerCallback(std::function<bool()> accept_function, st
  * Initializes the socket
  * @return result of the creation operation.
  */
-void TLSServerSocket::registerCallback(std::function<bool()> accept_function, 
std::function<int(std::vector<uint8_t>*, int *)> handler) {
-  fx = [this](std::function<bool()> accept_function, 
std::function<int(std::vector<uint8_t>*, int *)> handler) {
+void TLSServerSocket::registerCallback(std::function<bool()> accept_function, 
std::function<int(std::vector<uint8_t>*, int *)> handler, 
std::chrono::milliseconds timeout) {
+  fx = [this](std::function<bool()> accept_function, 
std::function<int(std::vector<uint8_t>*, int *)> handler, 
std::chrono::milliseconds timeout) {
     int ret = 0;
     std::vector<int> fds;
     int size;
     while (accept_function()) {
-      int fd = select_descriptor(3000);
+      int fd = select_descriptor(timeout.count());

Review comment:
       this is a narrowing conversion from at least 45 bits (signed) to 16 bits 
(unsigned); it could be made safe (and warning-free) with `gsl::narrow`




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to