Set the body, or, if you provide a null buffer, clear the body message
| 4837 | |
| 4838 | // Set the body, or, if you provide a null buffer, clear the body message |
| 4839 | void |
| 4840 | TSHttpTxnErrorBodySet(TSHttpTxn txnp, char *buf, size_t buflength, char *mimetype) |
| 4841 | { |
| 4842 | sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS); |
| 4843 | |
| 4844 | HttpSM *sm = reinterpret_cast<HttpSM *>(txnp); |
| 4845 | HttpTransact::State *s = &(sm->t_state); |
| 4846 | |
| 4847 | // Cleanup anything already set. |
| 4848 | s->free_internal_msg_buffer(); |
| 4849 | ats_free(s->internal_msg_buffer_type); |
| 4850 | |
| 4851 | s->internal_msg_buffer = buf; |
| 4852 | s->internal_msg_buffer_size = buf ? buflength : 0; |
| 4853 | s->internal_msg_buffer_fast_allocator_size = -1; |
| 4854 | |
| 4855 | s->internal_msg_buffer_type = mimetype; |
| 4856 | } |
| 4857 | |
| 4858 | char * |
| 4859 | TSHttpTxnErrorBodyGet(TSHttpTxn txnp, size_t *buflength, char **mimetype) |