Skip to content

Commit

Permalink
Update mgraftcp
Browse files Browse the repository at this point in the history
  • Loading branch information
hmgle committed Jul 17, 2021
1 parent fa5e281 commit 65a6ca0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions local/cmd/mgraftcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ const (
func clientMain(args []string) int {
argc := C.int(len(args))

log.Printf("Got %v args: %v\n", argc, args)

argv := (*[maxArgsLen]*C.char)(C.alloc_string_slice(argc))
defer C.free(unsafe.Pointer(argv))

Expand Down Expand Up @@ -128,7 +126,15 @@ func main() {
var fixArgs []string
fixArgs = append(fixArgs, os.Args[0])
fixArgs = append(fixArgs, "-p", strconv.Itoa(faddr.Port), "-f", pipePath)
if blackIPFile != "" {
fixArgs = append(fixArgs, "-b", blackIPFile)
}
if whiteIPFile != "" {
fixArgs = append(fixArgs, "-w", whiteIPFile)
}
if notIgnoreLocal {
fixArgs = append(fixArgs, "-n")
}
fixArgs = append(fixArgs, args[0:]...)
log.Printf("fixArgs: %+v\n", fixArgs)
retCode = clientMain(fixArgs)
}

0 comments on commit 65a6ca0

Please sign in to comment.