bneradt commented on code in PR #12484:
URL: https://github.com/apache/trafficserver/pull/12484#discussion_r2353837052


##########
src/api/InkAPI.cc:
##########
@@ -2948,9 +2948,21 @@ TSHttpHdrStatusSet(TSMBuffer bufp, TSMLoc obj, 
TSHttpStatus status)
   SET_HTTP_HDR(h, bufp, obj);
   ink_assert(static_cast<HdrHeapObjType>(h.m_http->m_type) == 
HdrHeapObjType::HTTP_HEADER);
   h.status_set(static_cast<HTTPStatus>(status));
+
+  if (txnp != nullptr && !setter.empty()) {
+    sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+    HttpSM *sm                               = reinterpret_cast<HttpSM 
*>(txnp);
+    sm->t_state.http_return_code_setter_name = setter;
+  }

Review Comment:
   Sounds good. Yes, it is ugly to have to pass txnp for TSHttpHdrStatusSet.
   
   I added a commit that avoids this by associating the txn with the TSMLoc 
when the Req/Rsp is retrieved. That way, later, we can look it up in the 
associated map. How does this look? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to