MCPcopy Create free account
hub / github.com/apache/trafficserver / setConnection

Method setConnection

include/iocore/net/UDPPacket.h:132–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132inline void
133UDPPacket::setConnection(UDPConnection *c)
134{
135 /*Code reviewed by Case Larsen. Previously, we just had
136 ink_assert(!conn). This prevents tunneling of packets
137 correctly---that is, you get packets from a server on a udp
138 conn. and want to send it to a player on another connection, the
139 assert will prevent that. The "if" clause enables correct
140 handling of the connection ref. counts in such a scenario. */
141
142 if (p.conn) {
143 if (p.conn == c) {
144 return;
145 }
146 p.conn->Release();
147 p.conn = nullptr;
148 }
149 p.conn = c;
150 p.conn->AddRef();
151}
152
153inline UDPConnection *
154UDPPacket::getConnection()

Callers 3

sendMethod · 0.80

Calls 2

AddRefMethod · 0.80
ReleaseMethod · 0.45

Tested by

no test coverage detected