On Apr 2, 2014, at 8:33 AM, Leif Hedstrom <zw...@apache.org> wrote:

> Hi,
> 
> I’d like to extend these two (existing) APIs
> 
>       void TSRedirectUrlSet(TSHttpTxn txnp, const char* url, const int 
> url_len);
>       const char* TSRedirectUrlGet(TSHttpTxn txnp, int *url_len_ptr);  
> 
> 
> with this addition:
> 
>       int TSRedirectRetriesGet()
> 
> 
> This allows for a plugin using these API to do for example
> 
>       1. Apply different changes to the redirection based on which attempt it 
> is (e.g. try a.example.com on the first try, and b.example.com on the second 
> try).
>       2. Allow it to stop retrying at will, before we hit the max number of 
> retries (e.g. avoid trying one host, a.example.com, repeatedly)
> 
> The naming of this API is a little less than ideal (I think these should have 
> been member of the Http / Txn family), but I picked a name that’s inline with 
> the existing APIs for consistency (stay within the “family”). I don’t think 
> it makes sense to have a Set() method on this, since this is an internal 
> counter.

This seems reasonable. I'd want the return value to be unsigned, though that 
would not be consistent with other APIs. How does this interact with the 
"redirect" remap type?

J

Reply via email to