shinrich commented on code in PR #13412:
URL: https://github.com/apache/trafficserver/pull/13412#discussion_r3623591013


##########
src/api/InkAPI.cc:
##########
@@ -4921,6 +4941,21 @@ TSHttpTxnServerPacketMarkSet(TSHttpTxn txnp, int mark)
   return TS_SUCCESS;
 }
 
+TSReturnCode
+TSHttpTxnServerPacketMarkSet(TSHttpTxn txnp, int mark, int mask)
+{
+  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+
+  // The current mark lives on the transaction config so the masked update 
composes
+  // correctly even before an origin connection exists.
+  TSMgmtInt current = 0;
+  TSHttpTxnConfigIntGet(txnp, TS_CONFIG_NET_SOCK_PACKET_MARK_OUT, &current);
+  uint32_t new_mark =
+    (static_cast<uint32_t>(current) & ~static_cast<uint32_t>(mask)) | 
(static_cast<uint32_t>(mark) & static_cast<uint32_t>(mask));
+
+  return TSHttpTxnServerPacketMarkSet(txnp, static_cast<int>(new_mark));

Review Comment:
   We should 



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