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.
| 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. |
| 1607 | static const char * |
| 1608 | TSMimeFieldValueGet(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 | |
| 1621 | static void |
| 1622 | TSMimeFieldValueSet(TSMBuffer bufp, TSMLoc field_obj, int idx, const char *value, int length) |
no test coverage detected