[ 
https://issues.apache.org/jira/browse/TS-1953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13726880#comment-13726880
 ] 

Igor Galić commented on TS-1953:
--------------------------------

{code}
/* hideous sample code. Pretty sure we can do better */

bool
TSVersionGE(int major, int minor = -1, int patch = -1) {
  if ( !(TSTrafficServerVersionGetMajor >= major)) {
     return false;
  } else if (minor != -1) {
     if ( !(TSTrafficServerVersionGetMinor >= minor)) {
        return false;
     } else if (patch != -1 ) {
        if ( !(TSTrafficServerVersionGetPatch >= patch)) {
           return false;
        }
     }
  }
  return true;
}
{code}
                
> remove check_ts_version() from (example) plugins or make it an API
> ------------------------------------------------------------------
>
>                 Key: TS-1953
>                 URL: https://issues.apache.org/jira/browse/TS-1953
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Plugins
>            Reporter: Igor Galić
>             Fix For: sometime
>
>
> almost every single of our (example) plugins has a function 
> {{chec_ts_version()}}. If this boiler-code is so crucial to a plugin's 
> functionality, we should offer an API for it, instead of making developers 
> write (copy) that code every time.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to