Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #5

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ type header struct {

// goroutine to handle output
func writer() {
w := bufio.NewWriter(os.Stdout)
defer w.Flush()
for res := range Results {
//fmt.Fprintln(w, res)
fmt.Println(res)
}
}
Expand Down Expand Up @@ -64,8 +67,6 @@ func spawnWorkers(n int, wordlist *string, nparams *int) {
wg.Done()
}()
}

// wait for all jobs to be finished before ending
wg.Wait()
close(Results)
}
Expand Down Expand Up @@ -105,7 +106,6 @@ func main() {
Header = header{hname, hvalue}
}

// set proxy
if *proxy != "" {
os.Setenv("PROXY", *proxy)
UseProxy = true
Expand All @@ -124,16 +124,15 @@ func main() {
os.Exit(1)
}

// set up concurrency
//var wg sync.WaitGroup

// open chans
Results = make(chan string)
Queue = make(chan string, 1)

// start pushing input, when done, close Queue
// start pushing input
go reader()
// start *threads workers
// ended by Queue closing, when done, close Results
go spawnWorkers(*threads, wordlist, nparams)
// start writing output
// ended by Results closing
writer()
}