SolidWallOfCode commented on a change in pull request #7023:
URL: https://github.com/apache/trafficserver/pull/7023#discussion_r500315024



##########
File path: proxy/ParentSelection.cc
##########
@@ -1869,23 +1871,65 @@ void
 show_result(ParentResult *p)
 {
   switch (p->result) {
-  case PARENT_UNDEFINED:
-    printf("result is PARENT_UNDEFINED\n");
+  case TS_PARENT_UNDEFINED:
+    printf("result is TS_PARENT_UNDEFINED\n");
     break;
-  case PARENT_DIRECT:
-    printf("result is PARENT_DIRECT\n");
+  case TS_PARENT_DIRECT:
+    printf("result is TS_PARENT_DIRECT\n");
     break;
-  case PARENT_SPECIFIED:
-    printf("result is PARENT_SPECIFIED\n");
+  case TS_PARENT_SPECIFIED:
+    printf("result is TS_PARENT_SPECIFIED\n");
     printf("hostname is %s\n", p->hostname);
     printf("port is %d\n", p->port);
     break;
-  case PARENT_FAIL:
-    printf("result is PARENT_FAIL\n");
+  case TS_PARENT_FAIL:
+    printf("result is TS_PARENT_FAIL\n");
     break;
   default:
     // Handled here:
     // PARENT_AGENT
     break;
   }
 }
+
+void
+ParentResult::copyFrom(TSParentResult *r)
+{
+  this->hostname = r->hostname;
+  this->port     = r->port;
+  this->retry    = r->retry;
+  this->result   = r->result;
+  memcpy(this->chash_init, r->chash_init, TS_MAX_GROUP_RINGS * sizeof(bool));
+  this->first_choice_status = r->first_choice_status;
+  this->line_number         = r->line_number;
+  this->last_parent         = r->last_parent;
+  this->start_parent        = r->start_parent;
+  this->last_group          = r->last_group;
+  this->wrap_around         = r->wrap_around;
+  memcpy(this->mapWrapped, r->mapWrapped, 2 * sizeof(bool));
+  this->last_lookup = r->last_lookup;
+  for (int i = 0; i < TS_MAX_GROUP_RINGS; ++i) {
+    this->chashIter[i] = r->chashIter[i];
+  }
+}
+
+void
+ParentResult::copyTo(TSParentResult *r)

Review comment:
       Any reason these aren't assignment operators?




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