[ 
https://issues.apache.org/jira/browse/GEODE-10259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17529568#comment-17529568
 ] 

ASF GitHub Bot commented on GEODE-10259:
----------------------------------------

pivotal-jbarrett commented on code in PR #962:
URL: https://github.com/apache/geode-native/pull/962#discussion_r861178697


##########
cppcache/src/ClientProxyMembershipID.cpp:
##########
@@ -185,31 +182,31 @@ void ClientProxyMembershipID::toData(DataOutput&) const {
 void ClientProxyMembershipID::fromData(DataInput& input) {
   // deserialization for PR FX HA
 
-  auto length = input.readArrayLength();
-  auto hostAddress = new uint8_t[length];
-  input.readBytesOnly(hostAddress, length);
-  auto hostPort = input.readInt32();
-  auto hostname =
+  const auto length = input.readArrayLength();
+  auto hostAddress = std::vector<uint8_t>(length);
+  input.readBytesOnly(hostAddress.data(), length);
+  const auto hostPort = input.readInt32();
+  const auto hostname =
       std::dynamic_pointer_cast<CacheableString>(input.readObject());
-  auto splitbrain = input.read();
-  auto dcport = input.readInt32();
-  auto vPID = input.readInt32();
-  auto vmKind = input.read();
-  auto aStringArray = CacheableStringArray::create();
+  const auto splitbrain = input.read();
+  const auto dcport = input.readInt32();
+  const auto vPID = input.readInt32();
+  const auto vmKind = input.read();
+  const auto aStringArray = CacheableStringArray::create();
   aStringArray->fromData(input);
-  auto dsName = std::dynamic_pointer_cast<CacheableString>(input.readObject());
-  auto uniqueTag =
+  const auto dsName =
       std::dynamic_pointer_cast<CacheableString>(input.readObject());
-  auto durableClientId =
+  const auto uniqueTag =
       std::dynamic_pointer_cast<CacheableString>(input.readObject());
-  auto durableClientTimeOut = std::chrono::seconds(input.readInt32());
-  int32_t vmViewId = 0;
+  const auto durableClientId =
+      std::dynamic_pointer_cast<CacheableString>(input.readObject());
+  const auto durableClientTimeOut = std::chrono::seconds(input.readInt32());
   readVersion(splitbrain, input);
 
-  initHostAddressVector(hostAddress, length);
+  initHostAddressVector(hostAddress.data(), length);
 
-  if (vmKind != ClientProxyMembershipID::LONER_DM_TYPE) {
-    vmViewId = std::stoi(uniqueTag->value());
+  if (vmKind != kVmKindLoaner) {
+    auto vmViewId = std::stoi(uniqueTag->value());
     initObjectVars(hostname->value().c_str(), hostPort,
                    durableClientId->value().c_str(), durableClientTimeOut,
                    dcport, vPID, vmKind, splitbrain, dsName->value().c_str(),

Review Comment:
   Oh god, there is a book you could write on poorly named symbols in here... 
If I get bored while making other changes maybe I will address this one.





> Update geode-native library protocol to 1.14
> --------------------------------------------
>
>                 Key: GEODE-10259
>                 URL: https://issues.apache.org/jira/browse/GEODE-10259
>             Project: Geode
>          Issue Type: Improvement
>            Reporter: Jacob Barrett
>            Priority: Major
>              Labels: pull-request-available
>
> The geode-native library still talks the Geode 1.0.0 protocol, update to at 
> 1.14.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to