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

[GitHub] [trafficserver] zwoop opened a new pull request, #9494: Properly support multiple instantiation in plugins.config

zwoop opened a new pull request, #9494:
URL: https://github.com/apache/trafficserver/pull/9494

   This fixes a problem with instantiating multiple SNI rules via plugins.config.
   
   Co-authors: @serrislew & @elsloo 


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


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

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on PR #9494:
URL: https://github.com/apache/trafficserver/pull/9494#issuecomment-1458508418

   Cherry-picked to v9.2.x


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


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

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on code in PR #9494:
URL: https://github.com/apache/trafficserver/pull/9494#discussion_r1128138359


##########
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:
   Never freed, global plugins are never reloaded / deleted.



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


[GitHub] [trafficserver] zwoop merged pull request #9494: Properly support multiple instantiation in plugins.config

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop merged PR #9494:
URL: https://github.com/apache/trafficserver/pull/9494


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


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

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #9494:
URL: https://github.com/apache/trafficserver/pull/9494#discussion_r1128142167


##########
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:
   I see. This is a one time initialiation and lasts for process lifetime. Thanks.



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


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

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
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