Leif Hedstrom created TS-2707:
---------------------------------

             Summary: 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


>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)

Reply via email to