ywkaras commented on a change in pull request #8052:
URL: https://github.com/apache/trafficserver/pull/8052#discussion_r669846600
##########
File path: include/ts/ts.h
##########
@@ -962,6 +967,7 @@ tsapi TSMLoc TSMimeHdrFieldGet(TSMBuffer bufp, TSMLoc hdr,
int idx);
*/
tsapi TSMLoc TSMimeHdrFieldFind(TSMBuffer bufp, TSMLoc hdr, const char *name,
int length);
+tsapi TSReturnCode TSMimeHdrFieldFastFind(TSMBuffer bufp, TSMLoc hdr, const
char *name, int length, TSMLoc *locp);
Review comment:
I suggest adding this to apidefs.h.in:
```
// WARNING: Contents invalidated by calls to TSHttpTxnReenable().
typedef struct {
void * _d[3]; // private
} TSHdrHandle;
#define TS_MLOC_FROM_HDR_HANDLE(HH_) ((TSMLoc *)((HH_)._d))
```
and changing the last parameter like this:
```
tsapi TSReturnCode TSMimeHdrFieldFastFind(TSMBuffer bufp, TSMLoc hdr, const
char *name, int length, TSHdrHandle *);
```
And in InkAPI.cc adding:
```
static_assert(sizeof(TSHdrHandle) >= sizeof(MIMEFieldSDKHandle) &&
alignof(TSHdrHandle) == alignof(MIMEFieldSDKHandle))
```
for greater type safety / static checking for mistakes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]