I thought when we discussed this you were going to segregate these by type.
One might consider splitting the current TSMLoc in to TSHdrLoc and TSMLoc,
the latter requiring a release. I agreed with your view that it was best to
have distinct types to avoid confusion about what should be passed to which
API functions.

On Thu, Aug 22, 2019 at 12:06 PM Walt Karas <wka...@verizonmedia.com.invalid>
wrote:

> Nominally, plugins are supposed to call TSHandleMLocRelease() for all
> TSMLoc values returned by the API.  But in practice it is only necessary to
> call it for TSMLoc values that refer to MIME header fields:
>
>
> https://github.com/apache/trafficserver/blob/d75af6f2eb6c63aa216111bd7f477f1f4c775580/src/traffic_server/InkAPI.cc#L2046
>
> This adds significant complexity to plugin code.  In some cases, the API
> itself forces plugins to ignore the nominal need to call the release
> function for TSMLoc values that don't refer for MIME header
> fields.  TSRemapFromUrlGet() and TSRemapToUrlGet() returns TSMLoc values,
> but not a TSMBuffer value, making it impossible release the TSMLoc values.
> I propose adding the API function:
>
> void TSMimeHdrFieldMLocRelease(TSMbuffer, TSMLoc);
>

Reply via email to