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


##########
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:
   `TSHttpTxnStatusSet` also sets `sm->t_state.http_return_code`, but that 
doesn't happen here which seems like the two fields could get out of sync?



##########
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:
   This seems out of place here.  This function was just operating on its 
arguments, but the change to also update the transaction is only situationally 
relevant.  Wouldn't setting the return code setter be a separate function?



-- 
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