summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classic.go6
-rw-r--r--main.go2
2 files changed, 6 insertions, 2 deletions
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{}{}
diff --git a/main.go b/main.go
index bd30a4c..5673441 100644
--- a/main.go
+++ b/main.go
@@ -41,7 +41,7 @@ func main() {
}
getLeakProfile(func() {
- classic(*startURL, *maxConcurrency, *maxURLs)
+ classic(*startURL, *maxConcurrency, *maxURLs, 1)
})
}