TSMimeHdrFieldNameSet

Synopsis

#include <ts/ts.h>
TSReturnCode TSMimeHdrFieldNameSet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, const char *name, int length)

Description

TSMimeHdrFieldNameSet() sets the name of the MIME field identified by bufp, hdr, and field to name. The name is copied into the header represented by bufp and does not have to be null terminated. length is the length of name, or -1 if name is null terminated.

A header field name is stored with a 16-bit length, so it is limited to 65535 (UINT16_MAX) bytes. A name longer than that is rejected: the field’s existing name is left unchanged and the function returns TS_ERROR.

This function returns TS_SUCCESS if the name was set, TS_ERROR if not.