MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / ActiveBySession

Method ActiveBySession

internal/bridge/taskmanager.go:142–158  ·  view source on GitHub ↗

ActiveBySession returns tasks in Pending or Running state for a session.

(sessionID string)

Source from the content-addressed store, hash-verified

140
141// ActiveBySession returns tasks in Pending or Running state for a session.
142func (tm *TaskManager) ActiveBySession(sessionID string) []*Task {
143 tm.mu.RLock()
144 defer tm.mu.RUnlock()
145
146 var out []*Task
147 for k, t := range tm.tasks {
148 if k.sessionID == sessionID {
149 t.mu.Lock()
150 active := t.State == TaskPending || t.State == TaskRunning
151 t.mu.Unlock()
152 if active {
153 out = append(out, t)
154 }
155 }
156 }
157 return out
158}
159
160// BindCommand associates an injected command ID with a task.
161// This enables reverse lookup from command results to tasks.

Callers 1

TestTask_ActiveBySessionFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestTask_ActiveBySessionFunction · 0.76