| 2286 | } |
| 2287 | |
| 2288 | TSReturnCode |
| 2289 | TSMimeHdrFieldValueInt64Set(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, int64_t value) |
| 2290 | { |
| 2291 | // Allow to modify the buffer only |
| 2292 | // if bufp is modifiable. If bufp is not modifiable return |
| 2293 | // TS_ERROR. If allowed, return TS_SUCCESS. Changed the |
| 2294 | // return value of function from void to TSReturnCode. |
| 2295 | sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS); |
| 2296 | sdk_assert((sdk_sanity_check_mime_hdr_handle(hdr) == TS_SUCCESS) || (sdk_sanity_check_http_hdr_handle(hdr) == TS_SUCCESS)); |
| 2297 | sdk_assert(sdk_sanity_check_field_handle(field, hdr) == TS_SUCCESS); |
| 2298 | |
| 2299 | if (!isWriteable(bufp)) { |
| 2300 | return TS_ERROR; |
| 2301 | } |
| 2302 | |
| 2303 | char tmp[20]; |
| 2304 | int len = mime_format_int64(tmp, value, sizeof(tmp)); |
| 2305 | |
| 2306 | TSMimeFieldValueSet(bufp, field, idx, tmp, len); |
| 2307 | return TS_SUCCESS; |
| 2308 | } |
| 2309 | |
| 2310 | TSReturnCode |
| 2311 | TSMimeHdrFieldValueUintSet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, unsigned int value) |
no test coverage detected