| 1438 | } |
| 1439 | |
| 1440 | TSReturnCode |
| 1441 | TSMimeHdrDestroy(TSMBuffer bufp, TSMLoc obj) |
| 1442 | { |
| 1443 | // Allow to modify the buffer only |
| 1444 | // if bufp is modifiable. If bufp is not modifiable return |
| 1445 | // TS_ERROR. If allowed, return TS_SUCCESS. Changed the |
| 1446 | // return value of function from void to TSReturnCode. |
| 1447 | sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS); |
| 1448 | sdk_assert((sdk_sanity_check_mime_hdr_handle(obj) == TS_SUCCESS) || (sdk_sanity_check_http_hdr_handle(obj) == TS_SUCCESS)); |
| 1449 | |
| 1450 | if (!isWriteable(bufp)) { |
| 1451 | return TS_ERROR; |
| 1452 | } |
| 1453 | |
| 1454 | MIMEHdrImpl *mh = _hdr_mloc_to_mime_hdr_impl(obj); |
| 1455 | |
| 1456 | mime_hdr_destroy((reinterpret_cast<HdrHeapSDKHandle *>(bufp))->m_heap, mh); |
| 1457 | return TS_SUCCESS; |
| 1458 | } |
| 1459 | |
| 1460 | TSReturnCode |
| 1461 | TSMimeHdrClone(TSMBuffer dest_bufp, TSMBuffer src_bufp, TSMLoc src_hdr, TSMLoc *locp) |