You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/04/10 14:55:21 UTC

[jira] [Commented] (TS-2707) Migrate TSRedirectUrlSet/Get to TSHttpTxnRedirectUrlSet/Get

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

ASF subversion and git services commented on TS-2707:
-----------------------------------------------------

Commit a7b7d5f98cfc94ba95ea572cadc5d14f8ecdf153 in trafficserver's branch refs/heads/master from [~zwoop]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=a7b7d5f ]

TS-2707 Migrate TSRedirectUrlSet/Get to TSHttpTxnRedirectUrlSet/Get

1. We leave TSRedirectUrlSet() / Get() as is (as far as functionality
goes). This makes this proposal both API and binary compatible with v4.2.x.

2. We mark them as Deprecated, removing the old API in 6.0.0.

3. We add TSHttpTxnRedirectSet() / Get() , with the new string ownership as
described above. This naming convention is much better aligned with the rest
of our APIs.

I left the URL string lengths as int type for now, we’ll discuss at the Summit
about TS-2514, changing our usage of “int” to more appropriate size_t etc.


> Migrate TSRedirectUrlSet/Get to TSHttpTxnRedirectUrlSet/Get
> -----------------------------------------------------------
>
>                 Key: TS-2707
>                 URL: https://issues.apache.org/jira/browse/TS-2707
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: TS API
>            Reporter: Leif Hedstrom
>            Assignee: Leif Hedstrom
>              Labels: api-addition
>             Fix For: 5.0.0
>
>
> From my Email:
> So I’ve spent some more time on this, and instead of the above, I’d like to propose the following:
> 1. We leave TSRedirectUrlSet() / Get() as is (as far as functionality goes). This makes this proposal both API and binary compatible with v4.2.x.
> 2. We mark them as Deprecated, removing the old API in 6.0.0.
> 3. We add TSHttpTxnRedirectSet() / Get() , with the new string ownership as described above. This naming convention is much better aligned with the rest of our APIs.
> I left the URL string lengths as int type for now, we’ll discuss at the Summit about TS-2514, changing our usage of “int” to more appropriate size_t etc.
> Cheers,
> — Leif
> {code}
>  /**
>     This is a generalization of the TSHttpTxnFollowRedirect(), but gives finer
>     control over the behavior. Instead of using the Location: header for the new
>     destination, this API takes the new URL as a parameter. Calling this API
>     transfers the ownership of the URL from the plugin to the core, so you must
>     make sure it is heap allocated, and that you do not free it.
>     Calling this API implicitly also enables the "Follow Redirect" feature, so
>     there is no rason to call TSHttpTxnFollowRedirect() as well.
>     @param txnp the transaction pointer
>     @param url  a heap allocated string with the URL
>     @param url_len the length of the URL
>  */
>  tsapi void TSHttpTxnRedirectUrlSet(TSHttpTxn txnp, const char* url, int url_len);
>  tsapi TS_DEPRECATED void TSRedirectUrlSet(TSHttpTxn txnp, const char* url, const int url_len);
>  /**
>     Return the current (if set) redirection URL string. This is still owned by the
>     core, and must not be free'd.
>     @param txnp the transaction pointer
>     @param url_len_ptr a pointer to where the URL length is to be stored
>     @return the url string
>  */
>  tsapi const char* TSHttpTxnRedirectUrlGet(TSHttpTxn txnp, int* url_len_ptr);
>  tsapi TS_DEPRECATED const char* TSRedirectUrlGet(TSHttpTxn txnp, int* url_len_ptr);
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)