diff options
| author | demo <demo@antix1> | 2026-05-27 12:09:31 -0400 |
|---|---|---|
| committer | demo <demo@antix1> | 2026-05-27 12:09:31 -0400 |
| commit | ebb7f3eb80c86ae110aaaaf73381e677c33699c1 (patch) | |
| tree | 413918a80633d258ceb44b51471f84684ec36aa0 | |
| parent | 7852eae1e9653d9a62ff3c82b8fac2954ee1944f (diff) | |
wip: prototype a max-depth limitation
It's just bolted on with a constant right now though.
| -rw-r--r-- | classic.go | 6 | ||||
| -rw-r--r-- | main.go | 2 |
2 files changed, 6 insertions, 2 deletions
@@ -8,7 +8,7 @@ import ( "sync" ) -func classic(startURL url.URL, maxConcurrency, maxURLs int) { +func classic(startURL url.URL, maxConcurrency, maxURLs, maxDepth int) { worklist := make(chan []packet) var numPendingSends int @@ -40,6 +40,10 @@ loop: break loop } + if p.depth == maxDepth { + continue + } + numPendingSends++ wg.Go(func() { sema <- struct{}{} @@ -41,7 +41,7 @@ func main() { } getLeakProfile(func() { - classic(*startURL, *maxConcurrency, *maxURLs) + classic(*startURL, *maxConcurrency, *maxURLs, 1) }) } |
