From bc4b2f6a7028b54ae884203929032b1e674a09ba Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Wed, 9 Sep 2020 15:47:05 +0000 Subject: [PATCH] Fix TSHttpTxnServerPacket* API's to correctly update existing server connections --- src/traffic_server/InkAPI.cc | 42 ++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc index 9dd2c3d5535..c34d2602883 100644 --- a/src/traffic_server/InkAPI.cc +++ b/src/traffic_server/InkAPI.cc @@ -5814,14 +5814,12 @@ TSHttpTxnServerPacketMarkSet(TSHttpTxn txnp, int mark) HttpSM *sm = (HttpSM *)txnp; // change the mark on an active server session - if (nullptr != sm->ua_txn) { - Http1ServerSession *ssn = sm->ua_txn->get_server_session(); - if (nullptr != ssn) { - NetVConnection *vc = ssn->get_netvc(); - if (vc != nullptr) { - vc->options.packet_mark = (uint32_t)mark; - vc->apply_options(); - } + Http1ServerSession *ssn = sm->get_server_session(); + if (nullptr != ssn) { + NetVConnection *vc = ssn->get_netvc(); + if (vc != nullptr) { + vc->options.packet_mark = (uint32_t)mark; + vc->apply_options(); } } @@ -5856,14 +5854,12 @@ TSHttpTxnServerPacketTosSet(TSHttpTxn txnp, int tos) HttpSM *sm = (HttpSM *)txnp; // change the tos on an active server session - if (nullptr != sm->ua_txn) { - Http1ServerSession *ssn = sm->ua_txn->get_server_session(); - if (nullptr != ssn) { - NetVConnection *vc = ssn->get_netvc(); - if (vc != nullptr) { - vc->options.packet_tos = (uint32_t)tos; - vc->apply_options(); - } + Http1ServerSession *ssn = sm->get_server_session(); + if (nullptr != ssn) { + NetVConnection *vc = ssn->get_netvc(); + if (vc != nullptr) { + vc->options.packet_tos = (uint32_t)tos; + vc->apply_options(); } } @@ -5898,14 +5894,12 @@ TSHttpTxnServerPacketDscpSet(TSHttpTxn txnp, int dscp) HttpSM *sm = (HttpSM *)txnp; // change the tos on an active server session - if (nullptr != sm->ua_txn) { - Http1ServerSession *ssn = sm->ua_txn->get_server_session(); - if (nullptr != ssn) { - NetVConnection *vc = ssn->get_netvc(); - if (vc != nullptr) { - vc->options.packet_tos = (uint32_t)dscp << 2; - vc->apply_options(); - } + Http1ServerSession *ssn = sm->get_server_session(); + if (nullptr != ssn) { + NetVConnection *vc = ssn->get_netvc(); + if (vc != nullptr) { + vc->options.packet_tos = (uint32_t)dscp << 2; + vc->apply_options(); } }