You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bneradt (via GitHub)" <gi...@apache.org> on 2023/03/07 16:17:27 UTC

[GitHub] [trafficserver] bneradt commented on a diff in pull request #9494: Properly support multiple instantiation in plugins.config

bneradt commented on code in PR #9494:
URL: https://github.com/apache/trafficserver/pull/9494#discussion_r1127187886


##########
plugins/experimental/rate_limit/rate_limit.cc:
##########
@@ -47,27 +48,31 @@ TSPluginInit(int argc, const char *argv[])
     return;
   }
 
-  TSUserArgIndexReserve(TS_USER_ARGS_VCONN, PLUGIN_NAME, "VConn state information", &gVCIdx);
+  if (-1 == gVCIdx) {
+    TSUserArgIndexReserve(TS_USER_ARGS_VCONN, PLUGIN_NAME, "VConn state information", &gVCIdx);
+  }
 
   if (argc > 1) {
     if (!strncasecmp(argv[1], "SNI=", 4)) {
-      TSCont sni_cont       = TSContCreate(sni_limit_cont, nullptr);
-      SniSelector *selector = new SniSelector();
+      if (gSNISelector == nullptr) {
+        TSCont sni_cont = TSContCreate(sni_limit_cont, nullptr);
+        gSNISelector    = new SniSelector();

Review Comment:
   Where is this free'd?



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