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

Method state_api_callback

src/proxy/http/HttpSM.cc:1322–1353  ·  view source on GitHub ↗

InkAPI.cc calls us directly here to avoid problems with setting and changing the default_handler function. As such, this is an entry point and needs to handle the reentrancy counter and deallocation of the state machine if necessary

Source from the content-addressed store, hash-verified

1320// deallocation of the state machine if necessary
1321//
1322int
1323HttpSM::state_api_callback(int event, void *data)
1324{
1325 ink_release_assert(magic == HTTP_SM_MAGIC_ALIVE);
1326
1327 ink_assert(reentrancy_count >= 0);
1328 reentrancy_count++;
1329
1330 this->milestone_update_api_time();
1331
1332 STATE_ENTER(&HttpSM::state_api_callback, event);
1333
1334 state_api_callout(event, data);
1335
1336 // The sub-handler signals when it is time for the state
1337 // machine to exit. We can only exit if we are not reentrantly
1338 // called otherwise when the our call unwinds, we will be
1339 // running on a dead state machine
1340 //
1341 // Because of the need for an api shutdown hook, kill_this()
1342 // is also reentrant. As such, we don't want to decrement
1343 // the reentrancy count until after we run kill_this()
1344 //
1345 if (terminate_sm == true && reentrancy_count == 1) {
1346 kill_this();
1347 } else {
1348 reentrancy_count--;
1349 ink_assert(reentrancy_count >= 0);
1350 }
1351
1352 return VC_EVENT_CONT;
1353}
1354
1355int
1356HttpSM::state_api_callout(int event, void * /* data ATS_UNUSED */)

Callers 2

event_handlerMethod · 0.80
TSHttpTxnReenableFunction · 0.80

Calls 1

Tested by

no test coverage detected