Description
There are a small'ish number of APIs, that (for legacy reasons I believe) makes copies of the marshalled header strings, just to make them NULL terminated. None of these APIs claim to guarantee the strings to be NULL terminated, and all of our APIs pretty much says that you should never expect strings to be NULL terminated.
Eliminating this string duplication will make the APIs easier to use (since now TSHandleStringRelease() is completely unecessary), and will also make plugins faster (no mallocs and frees for these strings).
The APIs that are affected, only by contract (no API changes) are
const char * TSUrlSchemeGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlUserGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlPasswordGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlHostGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlPathGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlHttpParamsGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlHttpQueryGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlHttpFragmentGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSMimeHdrFieldNameGet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int *length);
const char *TSHttpHdrMethodGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSHttpHdrReasonGet(TSMBuffer bufp, TSMLoc obj, int *length);
TSReturnCode TSMimeHdrFieldValueStringGet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, const char **value_ptr, int *value_len_ptr);
From now on, these will never be NULL terminated.