[
https://issues.apache.org/jira/browse/TS-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13418918#comment-13418918
]
Phil Sorber commented on TS-1369:
---------------------------------
Right, what I was referring to was the TS_SDK_VERSION_#_# constant.
This is what I was doing before I found TS_SDK_VERSION_3_0:
{noformat}
#ifdef TS_VERSION_NUMBER
#if ((TS_VERSION_NUMBER >= 3000000) && (TS_VERSION_NUMBER < 3001000))
#define TS_API_30X
#elif ((TS_VERSION_NUMBER >= 3001000) && (TS_VERSION_NUMBER < 3003000))
#define TS_API_32X
#else
#error Cannot determine API version!
#endif
#else
#error TS_VERSION_NUMBER not defined!
#endif
{noformat}
And then in other places something like this:
{noformat}
#ifdef TS_API_32X
TSFetchUrl((const char *) li->request, li->req_len, (struct
sockaddr const *) li->addr, *contp, AFTER_BODY, tsfe);
#elif defined TS_API_30X
TSFetchUrl((const char *) li->request, li->req_len, li->ip,
li->port, *contp, AFTER_BODY, tsfe);
#endif
{noformat}
I figured that's what the TS_SDK_VERSION_#_# was intended for. I saw you also
have TS_SDK_VERSION_2_0 and you bumped it to TS_SDK_VERSION_3_0. These are also
used to register plugins. If that's not the intent, or no longer the intent,
that's fine. I just thought it may have been overlooked.
Alternatively, it might be nice just to have a TS_SDK_VERSION with a
monotonically increasing number each time an incompatible API change is made.
One that doesn't track the version and only changes when the API changes so you
don't have to deal with version ranges.
Barring that, I'll just stick with my solution that I cited above.
Thanks.
> TS_SDK_VERSION the same across incompatible API's
> -------------------------------------------------
>
> Key: TS-1369
> URL: https://issues.apache.org/jira/browse/TS-1369
> Project: Traffic Server
> Issue Type: Bug
> Components: TS API
> Affects Versions: 3.2.1, 3.2.0, 3.1.3, 3.1.2
> Reporter: Phil Sorber
> Assignee: James Peach
> Labels: api-change
>
> {noformat}
> 14:31 < PSUdaemon> what is the plan for TS_SDK_VERSION?
> 14:32 < PSUdaemon> i noticed the API changed from 3.0 to 3.2 but the
> TS_SDK_VERSION is the same
> 14:32 < PSUdaemon> at TS_SDK_VERSION_3_0
> 14:39 <@jpeach> I'm not sure when TS_SDK_VERSION is supposed to rev
> 14:39 <@jpeach> 3.2 removed some deprecated APIs and added a few new ones
> 14:39 < PSUdaemon> and altered some too
> 14:39 < PSUdaemon> like TSFetchUrl
> 14:39 <@jpeach> APIs that were retained are supposed to be binary and source
> compatible
> 14:40 <@jpeach> oh, it grew a sockaddr argument, right?
> 14:40 < PSUdaemon> and lost and ip/port argument
> 14:41 < PSUdaemon> i like the upgrade, just the compatibility changes too
> 14:41 <@jpeach> yeh sounds like we should have revved it
> 14:42 <@jpeach> can you file a jura ticket and we can discuss revving for
> 3.2.1
> 14:42 < PSUdaemon> sure
> {noformat}
> 3.0:
> {noformat}
> tsapi void TSFetchUrl(const char* headers, int request_len, unsigned int ip,
> int port , TSCont contp, TSFetchWakeUpOptions callback_options,TSFetchEvent
> events);
> {noformat}
> 3.2:
> {noformat}
> tsapi void TSFetchUrl(const char* request,int request_len, struct sockaddr
> const* addr, TSCont contp, TSFetchWakeUpOptions callback_options,TSFetchEvent
> event);
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira