You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Igor Galić (JIRA)" <ji...@apache.org> on 2013/08/01 23:19:48 UTC
[jira] [Comment Edited] (TS-1953) remove check_ts_version() from
(example) plugins or make it an API
[ https://issues.apache.org/jira/browse/TS-1953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13726880#comment-13726880 ]
Igor Galić edited comment on TS-1953 at 8/1/13 9:18 PM:
--------------------------------------------------------
{code}
bool
TSVersionGE(int major, int minor = -1, int patch = -1)
{
if (!(TS_MAJOR >= major)){
return false;
}
if (minor != -1 && !(TS_MINOR >= minor)) {
return false;
}
if (patch != -1 && !(TS_PATCH >= patch)) {
return false;
}
return true;
}
{code}
was (Author: i.galic):
{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