| 4119 | } |
| 4120 | |
| 4121 | TSReturnCode |
| 4122 | TSHttpTxnCachedRespModifiableGet(TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *obj) |
| 4123 | { |
| 4124 | sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS); |
| 4125 | sdk_assert(sdk_sanity_check_null_ptr((void *)bufp) == TS_SUCCESS); |
| 4126 | sdk_assert(sdk_sanity_check_null_ptr((void *)obj) == TS_SUCCESS); |
| 4127 | |
| 4128 | HttpSM *sm = reinterpret_cast<HttpSM *>(txnp); |
| 4129 | HttpTransact::State *s = &(sm->t_state); |
| 4130 | HTTPHdr *c_resp = nullptr; |
| 4131 | HTTPInfo *cached_obj = sm->t_state.cache_info.object_read; |
| 4132 | HTTPInfo *cached_obj_store = &(sm->t_state.cache_info.object_store); |
| 4133 | |
| 4134 | if ((!cached_obj) || (!cached_obj->valid())) { |
| 4135 | return TS_ERROR; |
| 4136 | } |
| 4137 | |
| 4138 | if (!cached_obj_store->valid()) { |
| 4139 | cached_obj_store->create(); |
| 4140 | } |
| 4141 | |
| 4142 | c_resp = cached_obj_store->response_get(); |
| 4143 | if (!c_resp->valid()) { |
| 4144 | cached_obj_store->response_set(cached_obj->response_get()); |
| 4145 | } |
| 4146 | c_resp = cached_obj_store->response_get(); |
| 4147 | s->api_modifiable_cached_resp = true; |
| 4148 | |
| 4149 | ink_assert(c_resp != nullptr && c_resp->valid()); |
| 4150 | *(reinterpret_cast<HTTPHdr **>(bufp)) = c_resp; |
| 4151 | *obj = reinterpret_cast<TSMLoc>(c_resp->m_http); |
| 4152 | sdk_assert(sdk_sanity_check_mbuffer(*bufp) == TS_SUCCESS); |
| 4153 | |
| 4154 | return TS_SUCCESS; |
| 4155 | } |
| 4156 | |
| 4157 | TSReturnCode |
| 4158 | TSHttpTxnCacheLookupStatusGet(TSHttpTxn txnp, int *lookup_status) |
nothing calls this directly
no test coverage detected