+ control: /install/*: test TCP port availability for DNS server
This commit is contained in:
parent
8d936b5756
commit
87147ac89f
13
control.go
13
control.go
|
@ -1059,6 +1059,10 @@ func handleInstallCheckConfig(w http.ResponseWriter, r *http.Request) {
|
||||||
respData.DNS.CanAutofix = canAutofix
|
respData.DNS.CanAutofix = canAutofix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
err = checkPortAvailable(reqData.DNS.IP, reqData.DNS.Port)
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
respData.DNS.Status = fmt.Sprintf("%v", err)
|
respData.DNS.Status = fmt.Sprintf("%v", err)
|
||||||
}
|
}
|
||||||
|
@ -1161,8 +1165,13 @@ func handleInstallConfigure(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
err = checkPacketPortAvailable(newSettings.DNS.IP, newSettings.DNS.Port)
|
err = checkPacketPortAvailable(newSettings.DNS.IP, newSettings.DNS.Port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpError(w, http.StatusBadRequest, "Impossible to listen on IP:port %s due to %s",
|
httpError(w, http.StatusBadRequest, "%s", err)
|
||||||
net.JoinHostPort(newSettings.DNS.IP, strconv.Itoa(newSettings.DNS.Port)), err)
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = checkPortAvailable(newSettings.DNS.IP, newSettings.DNS.Port)
|
||||||
|
if err != nil {
|
||||||
|
httpError(w, http.StatusBadRequest, "%s", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue