You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "SolidWallOfCode (via GitHub)" <gi...@apache.org> on 2023/02/10 22:02:22 UTC

[GitHub] [trafficserver] SolidWallOfCode commented on a diff in pull request #9358: tunnel_route: Support local inbound and proxy protocol ports

SolidWallOfCode commented on code in PR #9358:
URL: https://github.com/apache/trafficserver/pull/9358#discussion_r1103297182


##########
iocore/net/P_SNIActionPerformer.h:
##########
@@ -168,13 +225,13 @@ class TunnelDestination : public ActionItem
             to = (port - pos) - 1;
           }
         }
-        const auto &number_str = dst.substr(pos + 1, to);
+        std::string_view number_str{dst.substr(pos + 1, to)};
         if (!is_number(number_str)) {
           // it may be some issue on the configured string, place the char and keep going.
           real_dst += *c;
           continue;
         }
-        const std::size_t group_index = std::stoi(number_str);
+        const std::size_t group_index = std::stoi(std::string{number_str});

Review Comment:
   Oh no! Use `ts::svtoi` or `swoc::svtoi`. 



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