MCPcopy Create free account
hub / github.com/apache/trafficserver / TSMimeFieldValueGet

Function TSMimeFieldValueGet

src/api/InkAPI.cc:1607–1619  ·  view source on GitHub ↗

The following three helper functions should not be used in plugins! Since they are not used by plugins, there's no need to validate the input.

Source from the content-addressed store, hash-verified

1605// The following three helper functions should not be used in plugins! Since they are not used
1606// by plugins, there's no need to validate the input.
1607static const char *
1608TSMimeFieldValueGet(TSMBuffer /* bufp ATS_UNUSED */, TSMLoc field_obj, int idx, int *value_len_ptr)
1609{
1610 MIMEFieldSDKHandle *handle = reinterpret_cast<MIMEFieldSDKHandle *>(field_obj);
1611
1612 if (idx >= 0) {
1613 return mime_field_value_get_comma_val(handle->field_ptr, value_len_ptr, idx);
1614 } else {
1615 auto value{handle->field_ptr->value_get()};
1616 *value_len_ptr = static_cast<int>(value.length());
1617 return value.data();
1618 }
1619}
1620
1621static void
1622TSMimeFieldValueSet(TSMBuffer bufp, TSMLoc field_obj, int idx, const char *value, int length)

Callers 5

Calls 4

value_getMethod · 0.45
lengthMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected