mirror of
https://github.com/maride/afl-transmit.git
synced 2026-04-14 19:15:45 +00:00
Avoid reinventing the wheel, properly using TARs
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -27,20 +26,16 @@ func RegisterWatchdogFlags() {
|
||||
func WatchFuzzers(outputDirectory string) {
|
||||
// Loop forever
|
||||
for {
|
||||
// Loop over those fuzzer directories we want to share
|
||||
for _, localFuzzDir := range getTargetFuzzers(outputDirectory) {
|
||||
// Pack important parts of the fuzzer directory into a byte array
|
||||
fuzzerName := filepath.Base(localFuzzDir)
|
||||
packedFuzzer, packerErr := logistic.PackFuzzer(fuzzerName, localFuzzDir)
|
||||
if packerErr != nil {
|
||||
log.Printf("Failed to pack fuzzer: %s", packerErr)
|
||||
continue
|
||||
}
|
||||
|
||||
// and send it to our peers
|
||||
net.SendToPeers(packedFuzzer)
|
||||
// Pack important parts of the fuzzers into an archive
|
||||
packedFuzzers, packerErr := logistic.PackFuzzers(getTargetFuzzers(outputDirectory), outputDirectory)
|
||||
if packerErr != nil {
|
||||
log.Printf("Failed to pack fuzzer: %s", packerErr)
|
||||
continue
|
||||
}
|
||||
|
||||
// and send it to our peers
|
||||
net.SendToPeers(packedFuzzers)
|
||||
|
||||
// Sleep a bit
|
||||
time.Sleep(time.Duration(rescanSecs) * time.Second)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user