| 2184 | } |
| 2185 | |
| 2186 | unsigned int |
| 2187 | TSMimeHdrFieldValueUintGet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx) |
| 2188 | { |
| 2189 | sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS); |
| 2190 | sdk_assert((sdk_sanity_check_mime_hdr_handle(hdr) == TS_SUCCESS) || (sdk_sanity_check_http_hdr_handle(hdr) == TS_SUCCESS)); |
| 2191 | sdk_assert(sdk_sanity_check_field_handle(field, hdr) == TS_SUCCESS); |
| 2192 | |
| 2193 | int value_len; |
| 2194 | const char *value_str = TSMimeFieldValueGet(bufp, field, idx, &value_len); |
| 2195 | |
| 2196 | if (value_str == nullptr) { |
| 2197 | return 0; |
| 2198 | } |
| 2199 | |
| 2200 | return mime_parse_uint(value_str, value_str + value_len); |
| 2201 | } |
| 2202 | |
| 2203 | TSReturnCode |
| 2204 | TSMimeHdrFieldValueStringSet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, const char *value, int length) |