You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by shukitchan <gi...@git.apache.org> on 2016/11/06 18:24:52 UTC

[GitHub] trafficserver pull request #1201: TS-4994: make state configuration in ts_lu...

GitHub user shukitchan opened a pull request:

    https://github.com/apache/trafficserver/pull/1201

    TS-4994: make state configuration in ts_lua plugin

    @jpeach pls take a look when you have time.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shukitchan/trafficserver ts4994

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/1201.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1201
    
----
commit 9e78dfe78ae6b82ad933ddcf4cdc0c63ec9b1512
Author: Kit Chan <ki...@apache.org>
Date:   2016-11-06T17:06:44Z

    TS-4994: make max state configurable

commit d24749bf5fd9a52a8875c9ff9c4b0daaf4ac4f23
Author: Kit Chan <ki...@apache.org>
Date:   2016-11-06T18:23:23Z

    TS-4994: update documentation

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #1201: TS-4994: make state configuration in ts_lu...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1201#discussion_r86699484
  
    --- Diff: plugins/experimental/ts_lua/ts_lua.c ---
    @@ -64,18 +65,46 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int errbuf_s
     {
       int fn;
       int ret;
    +  int states                           = TS_LUA_MAX_STATE_COUNT;
    +  static const struct option longopt[] = {
    +    {"states", required_argument, 0, 's'}, {0, 0, 0, 0},
    +  };
    +
    +  argc--;
    +  argv++;
    +
    +  for (;;) {
    +    int opt;
    +
    +    opt = getopt_long(argc, (char *const *)argv, "", longopt, NULL);
    +    switch (opt) {
    +    case 's':
    +      states = atoi(optarg);
    +      // set state
    +      break;
    +    }
     
    -  if (argc < 3) {
    +    if (opt == -1) {
    +      break;
    +    }
    +  }
    +
    +  if (states > TS_LUA_MAX_STATE_COUNT || states < 1) {
    +    snprintf(errbuf, errbuf_size, "[TSRemapNewInstance] - invalid state in option input");
    --- End diff --
    
    Include the max and given values?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1201: TS-4994: make state configuration in ts_lua plugi...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1201
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/1074/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1201: TS-4994: make state configuration in ts_lua plugi...

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on the issue:

    https://github.com/apache/trafficserver/pull/1201
  
    Set the tags to the right please :).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #1201: TS-4994: make state configuration in ts_lu...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1201#discussion_r86699557
  
    --- Diff: plugins/experimental/ts_lua/ts_lua.c ---
    @@ -391,12 +422,38 @@ TSPluginInit(int argc, const char *argv[])
         return;
       }
     
    -  if (argc < 2) {
    +  int states                           = TS_LUA_MAX_STATE_COUNT;
    +  static const struct option longopt[] = {
    +    {"states", required_argument, 0, 's'}, {0, 0, 0, 0},
    +  };
    +
    +  for (;;) {
    +    int opt;
    +
    +    opt = getopt_long(argc, (char *const *)argv, "", longopt, NULL);
    +    switch (opt) {
    +    case 's':
    +      states = atoi(optarg);
    +      // set state
    +      break;
    +    }
    +
    +    if (opt == -1) {
    +      break;
    +    }
    +  }
    +
    +  if (states > TS_LUA_MAX_STATE_COUNT || states < 1) {
    +    TSError("[ts_lua][%s] invalid # of states from option input", __FUNCTION__);
    --- End diff --
    
    Print the value and the max.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #1201: TS-4994: make state configuration in ts_lu...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1201#discussion_r86699466
  
    --- Diff: plugins/experimental/ts_lua/ts_lua.c ---
    @@ -64,18 +65,46 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuf, int errbuf_s
     {
       int fn;
       int ret;
    +  int states                           = TS_LUA_MAX_STATE_COUNT;
    --- End diff --
    
    Newline below here so clang format doesn't make it ugly ;)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #1201: TS-4994: make state configuration in ts_lu...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1201#discussion_r86699540
  
    --- Diff: plugins/experimental/ts_lua/ts_lua.c ---
    @@ -391,12 +422,38 @@ TSPluginInit(int argc, const char *argv[])
         return;
       }
     
    -  if (argc < 2) {
    +  int states                           = TS_LUA_MAX_STATE_COUNT;
    --- End diff --
    
    Newline.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #1201: TS-4994: make state configuration in ts_lu...

Posted by bryancall <gi...@git.apache.org>.
Github user bryancall closed the pull request at:

    https://github.com/apache/trafficserver/pull/1201


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1201: TS-4994: make state configuration in ts_lua plugi...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1201
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1181/ for details.
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---