MCPcopy Create free account
hub / github.com/chainreactors/spray / putToOutput

Method putToOutput

core/pool/pool.go:82–103  ·  view source on GitHub ↗
(bl *baseline.Baseline)

Source from the content-addressed store, hash-verified

80}
81
82func (pool *BasePool) putToOutput(bl *baseline.Baseline) {
83 if bl.IsValid || bl.IsFuzzy {
84 bl.Collect()
85 pool.doPoc(bl)
86 } else if !bl.Collected && len(bl.Raw) > 0 {
87 bl.Extracteds.Merge(pkg.ProtonExtract(bl.Raw))
88 }
89 out := bl.Snapshot()
90 pool.Outwg.Add(1)
91 select {
92 case pool.OutputCh <- out:
93 case <-pool.ctx.Done():
94 // Close cancels the pool context before draining processCh. If OutputCh
95 // still has room, keep the already-produced result instead of dropping it
96 // because the local pool is shutting down.
97 select {
98 case pool.OutputCh <- out:
99 default:
100 pool.Outwg.Done()
101 }
102 }
103}
104
105func (pool *BasePool) doPoc(bl *baseline.Baseline) {
106 if !pool.Poc || len(bl.Frameworks) == 0 || bl.Url == nil {

Callers 7

handleBaselineMethod · 0.80
handleCrawlBaselineMethod · 0.80
HandlerMethod · 0.80
TestPutToOutput_NormalFunction · 0.80

Calls 5

doPocMethod · 0.95
ProtonExtractFunction · 0.92
CollectMethod · 0.80
SnapshotMethod · 0.80
DoneMethod · 0.45

Tested by 4

TestPutToOutput_NormalFunction · 0.64