MCPcopy
hub / github.com/USArmyResearchLab/Dshell / clean_plugin_chain

Function clean_plugin_chain

dshell/decode.py:83–102  ·  view source on GitHub ↗

This is called at the end of packet capture. It will go through the plugins and attempt to cleanup any connections that were not yet closed.

(plugin_index)

Source from the content-addressed store, hash-verified

81
82
83def clean_plugin_chain(plugin_index):
84 """
85 This is called at the end of packet capture.
86 It will go through the plugins and attempt to cleanup any connections
87 that were not yet closed.
88 """
89 if plugin_index >= len(plugin_chain):
90 # We are at the end of the chain
91 return
92
93 current_plugin = plugin_chain[plugin_index]
94
95 # need to flush even if there are no more plugins in the chain to ensure all packets are processed.
96 current_plugin.flush()
97
98 # Feed plugin chain with lingering packets released by flush.
99 for _packet in current_plugin.produce_packets():
100 feed_plugin_chain(plugin_index + 1, _packet)
101
102 clean_plugin_chain(plugin_index + 1)
103
104
105def decompress_file(filepath, extension, unzipdir):

Callers 1

process_filesFunction · 0.85

Calls 3

feed_plugin_chainFunction · 0.85
flushMethod · 0.45
produce_packetsMethod · 0.45

Tested by

no test coverage detected