Răsfoiți Sursa

kill process instead of sending SIGTERM on Windows (#3304)

fgsfds 2 luni în urmă
părinte
comite
a4c4f9efb3
1 a modificat fișierele cu 6 adăugiri și 1 ștergeri
  1. 6 1
      xray/process.go

+ 6 - 1
xray/process.go

@@ -239,7 +239,12 @@ func (p *process) Stop() error {
 	if !p.IsRunning() {
 		return errors.New("xray is not running")
 	}
-	return p.cmd.Process.Signal(syscall.SIGTERM)
+	
+	if runtime.GOOS == "windows" {
+		return p.cmd.Process.Kill()
+	} else {
+		return p.cmd.Process.Signal(syscall.SIGTERM)
+	}
 }
 
 func writeCrashReport(m []byte) error {