From ebb7f3eb80c86ae110aaaaf73381e677c33699c1 Mon Sep 17 00:00:00 2001 From: demo Date: Wed, 27 May 2026 12:09:31 -0400 Subject: wip: prototype a max-depth limitation It's just bolted on with a constant right now though. --- classic.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'classic.go') diff --git a/classic.go b/classic.go index bd689fc..deb14fd 100644 --- a/classic.go +++ b/classic.go @@ -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{}{} -- cgit v1.2.3