phrocker commented on a change in pull request #470: MINIFICPP-706 -
RawSiteToSite: remove code duplication
URL: https://github.com/apache/nifi-minifi-cpp/pull/470#discussion_r250646367
##########
File path: libminifi/src/sitetosite/RawSocketProtocol.cpp
##########
@@ -395,97 +395,37 @@ bool
RawSiteToSiteClient::getPeerList(std::vector<PeerStatus> &peers) {
}
}
-int RawSiteToSiteClient::writeRequestType(RequestType type) {
- if (type >= MAX_REQUEST_TYPE)
- return -1;
-
- return peer_->writeUTF(SiteToSiteRequest::RequestTypeStr[type]);
-}
-
-int RawSiteToSiteClient::readRequestType(RequestType &type) {
- std::string requestTypeStr;
-
- int ret = peer_->readUTF(requestTypeStr);
-
- if (ret <= 0)
- return ret;
+ int RawSiteToSiteClient::writeRequestType(RequestType type) {
+ if (type >= MAX_REQUEST_TYPE)
+ return -1;
- for (int i = NEGOTIATE_FLOWFILE_CODEC; i <= SHUTDOWN; i++) {
- if (SiteToSiteRequest::RequestTypeStr[i] == requestTypeStr) {
- type = (RequestType) i;
- return ret;
- }
+ return peer_->writeUTF(SiteToSiteRequest::RequestTypeStr[type]);
}
- return -1;
-}
-
-int RawSiteToSiteClient::readRespond(const std::shared_ptr<Transaction>
&transaction, RespondCode &code, std::string &message) {
- uint8_t firstByte;
Review comment:
Then that reliance may not be valid any longer. I think some parent class
details changed, but I will have to further investigate the HTTP portion. I
want to fully understand this. If it is a bug that may push when this should be
merged, but once I take a closer look at HTTP it may become obvious. What the
parent currently does, is an invalid reliance from the end of HTTP, but since
things changed in some of the accessory code it may never get there, meaning we
can make it pure virtual; however, I'll take a closer look at it while running
to validate that it's not a bug before going that route.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services