| 2167 | } |
| 2168 | |
| 2169 | int64_t |
| 2170 | TSMimeHdrFieldValueInt64Get(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx) |
| 2171 | { |
| 2172 | sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS); |
| 2173 | sdk_assert((sdk_sanity_check_mime_hdr_handle(hdr) == TS_SUCCESS) || (sdk_sanity_check_http_hdr_handle(hdr) == TS_SUCCESS)); |
| 2174 | sdk_assert(sdk_sanity_check_field_handle(field, hdr) == TS_SUCCESS); |
| 2175 | |
| 2176 | int value_len; |
| 2177 | const char *value_str = TSMimeFieldValueGet(bufp, field, idx, &value_len); |
| 2178 | |
| 2179 | if (value_str == nullptr) { |
| 2180 | return 0; |
| 2181 | } |
| 2182 | |
| 2183 | return mime_parse_int64(value_str, value_str + value_len); |
| 2184 | } |
| 2185 | |
| 2186 | unsigned int |
| 2187 | TSMimeHdrFieldValueUintGet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx) |
no test coverage detected