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

Method handle_event

src/api/InkContInternal.cc:143–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143int
144INKContInternal::handle_event(int event, void *edata)
145{
146 if (m_free_magic == INKCONT_INTERN_MAGIC_DEAD) {
147 ink_release_assert(!"Plugin tries to use a continuation which is deleted");
148 }
149 this->handle_event_count(event);
150 if (m_deleted) {
151 if (m_deletable) {
152 this->free();
153 } else {
154 Dbg(dbg_ctl_plugin, "INKCont Deletable but not deleted %d", m_event_count);
155 }
156 } else {
157 /* set the plugin context */
158 auto *previousContext = pluginThreadContext;
159 pluginThreadContext = reinterpret_cast<PluginThreadContext *>(m_context);
160 int retval = m_event_func((TSCont)this, (TSEvent)event, edata);
161 pluginThreadContext = previousContext;
162 if (edata && event == EVENT_INTERVAL) {
163 Event *e = reinterpret_cast<Event *>(edata);
164 if (e->period != 0) {
165 // In the interval case, we must re-increment the m_event_count for
166 // the next go around. Otherwise, our event count will go negative.
167 ink_release_assert(ink_atomic_increment((int *)&this->m_event_count, 1) >= 0);
168 }
169 }
170 return retval;
171 }
172 return EVENT_DONE;
173}

Callers

nothing calls this directly

Calls 3

handle_event_countMethod · 0.95
freeMethod · 0.95
ink_atomic_incrementFunction · 0.85

Tested by

no test coverage detected