hunyadi-dev commented on a change in pull request #805:
URL: https://github.com/apache/nifi-minifi-cpp/pull/805#discussion_r438108011
##########
File path: libminifi/src/FlowControlProtocol.cpp
##########
@@ -162,11 +164,12 @@ int FlowControlProtocol::sendRegisterReq() {
return -1;
// Calculate the total payload msg size
- uint32_t payloadSize = FlowControlMsgIDEncodingLen(FLOW_SERIAL_NUMBER, 0) +
FlowControlMsgIDEncodingLen(FLOW_YML_NAME, this->_controller->getName().size()
+ 1);
- uint32_t size = sizeof(FlowControlProtocolHeader) + payloadSize;
+ const auto payloadSize = FlowControlMsgIDEncodingLen(FLOW_SERIAL_NUMBER, 0)
+ FlowControlMsgIDEncodingLen(FLOW_YML_NAME,
gsl::narrow<int>(this->_controller->getName().size() + 1));
Review comment:
It does not matter if it throws here, it would still call terminate on
the thread that is starting up. I suggest maybe we should surround the calling
side with a `try`-`catch` block.
----------------------------------------------------------------
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]