I've done a preliminary implementation, based on the version that
returns the URLs as strings:

https://github.com/ywkaras/trafficserver/pull/4

On Tue, Jan 30, 2018 at 6:04 PM, Walt Karas <wka...@oath.com> wrote:
> Another alternative is to get handles to the "binary" URLs:
>
> TSReturnCode TSRemapFromUrlGet(TSHttpTxn txnp, TSMLoc *url_loc);
>
> TSReturnCode TSRemapToUrlGet(TSHttpTxn txnp, TSMLoc *url_loc);
>
> These would return, from the transaction object state, handles for
> url_map.getFromURL() and url_map.getToURL() respectively.
>
> TSUrlStringGet() could be used to convert these handles to the string
> representation of the URLs.  However, TSUrlStringGet() requires a
> TSMBuffer parameter.  BUT, TSUrlStringGet() does not actually USE the
> TSMBuffer parameter, it only validates it.  So, presumably, I could
> just remove the validation, and pass a dummy value for TSMBuffer.
>
> Curiouser and curiouser.
>
>
> On Tue, Jan 30, 2018 at 1:37 PM, Alan Carroll
> <solidwallofc...@oath.com.invalid> wrote:
>> I meant this
>>
>> On Tue, Jan 30, 2018 at 11:15 AM, Walt Karas <wka...@oath.com.invalid>
>> wrote:
>>
>>> Revised:
>>> (Nul-termination
>>> should not be expected/presumed.) .
>>
>>
>> vs.
>>
>>
>>> On Mon, Jan 29, 2018 at 4:55 PM, Walt Karas <wka...@oath.com> wrote:
>>> > The plugin would own them and would have to call TSFree() when done
>>> > with them.  They would be nul terminated.
>>>
>>
>> I'll got with the revised API as the final, as you indicated.

Reply via email to