You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/01/10 15:52:23 UTC

[GitHub] [trafficserver] SolidWallOfCode commented on a change in pull request #8589: SNIConfig: tunnel_route - Change the way we extract matched subgroups from the servename

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



##########
File path: iocore/net/SSLSNIConfig.cc
##########
@@ -140,21 +139,18 @@ SNIConfigParams::get(const std::string &servername) const
         offset = OVECSIZE / 3;
       }
 
-      const char *psubStrMatchStr = nullptr;
-      std::vector<std::string> groups;
+      ActionItem::Context::CapturedGroupViewVec groups;
+      groups.reserve(offset);
       for (int strnum = 1; strnum < offset; strnum++) {
-        pcre_get_substring(servername.c_str(), ovector, offset, strnum, &(psubStrMatchStr));
-        groups.emplace_back(psubStrMatchStr);
-      }
-      context._fqdn_wildcard_captured_groups = std::move(groups);
-      if (psubStrMatchStr) {
-        pcre_free_substring(psubStrMatchStr);
-      }
+        const std::size_t start  = ovector[2 * strnum];
+        const std::size_t length = ovector[2 * strnum + 1] - start;
 
-      return {&retval.actions, context};
+        groups.emplace_back(servername.data() + start, length);
+      }
+      return {&retval.actions, {groups}};

Review comment:
       Shouldn't that be `{std::move(groups)}`?




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

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org