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

Method callbackHandler

src/iocore/net/UnixUDPConnection.cc:67–104  ·  view source on GitHub ↗

called with continuation lock taken out We call Release because AddRef was called before entering here.

Source from the content-addressed store, hash-verified

65// called with continuation lock taken out
66// We call Release because AddRef was called before entering here.
67int
68UnixUDPConnection::callbackHandler(int event, void *data)
69{
70 (void)event;
71 (void)data;
72 callbackAction = nullptr;
73 if (continuation == nullptr) {
74 return EVENT_CONT;
75 }
76
77 if (m_errno) {
78 if (!shouldDestroy()) {
79 continuation->handleEvent(NET_EVENT_DATAGRAM_ERROR, this);
80 }
81 destroy(); // don't destroy until after calling back with error
82 Release();
83 return EVENT_CONT;
84 } else {
85 UDPPacket *p = nullptr;
86 SList(UDPPacket, alink) aq(inQueue.popall());
87
88 Dbg(dbg_ctl_udpnet, "UDPConnection::callbackHandler");
89 Queue<UDPPacket> result;
90 while ((p = aq.pop())) {
91 result.push(p);
92 }
93
94 if (!shouldDestroy()) {
95 continuation->handleEvent(NET_EVENT_DATAGRAM_READ_READY, &result);
96 } else {
97 while ((p = result.dequeue())) {
98 p->free();
99 }
100 }
101 }
102 Release();
103 return EVENT_CONT;
104}
105
106void
107UDPConnection::bindToThread(Continuation *c, EThread *t)

Callers 1

udp_callbackMethod · 0.80

Calls 6

popallMethod · 0.80
handleEventMethod · 0.45
popMethod · 0.45
pushMethod · 0.45
dequeueMethod · 0.45
freeMethod · 0.45

Tested by

no test coverage detected