mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2025-08-09 15:41:40 +02:00
Fix bug manage_superupdate
This commit is contained in:
@ -787,6 +787,7 @@ func manage_superupdate(w http.ResponseWriter, r *http.Request) {
|
||||
sconfig_temp.PeerAliveTimeout = httpobj.http_sconfig.PeerAliveTimeout
|
||||
sconfig_temp.SendPingInterval = httpobj.http_sconfig.SendPingInterval
|
||||
sconfig_temp.HttpPostInterval = httpobj.http_sconfig.HttpPostInterval
|
||||
sconfig_temp.DampingResistance = httpobj.http_sconfig.DampingResistance
|
||||
|
||||
PeerAliveTimeout, err := extractParamsFloat(r.Form, "PeerAliveTimeout", 64, nil)
|
||||
if err == nil {
|
||||
@ -801,7 +802,7 @@ func manage_superupdate(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
DampingResistance, err := extractParamsFloat(r.Form, "DampingResistance", 64, nil)
|
||||
if err == nil {
|
||||
if DampingResistance < 0 || DampingResistance >= 0 {
|
||||
if DampingResistance < 0 || DampingResistance >= 1 {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
w.Write([]byte(fmt.Sprintf("Paramater DampingResistance %v: Must in range [0,1)\n", DampingResistance)))
|
||||
return
|
||||
@ -840,13 +841,13 @@ func manage_superupdate(w http.ResponseWriter, r *http.Request) {
|
||||
httpobj.http_sconfig.PeerAliveTimeout = sconfig_temp.PeerAliveTimeout
|
||||
httpobj.http_sconfig.SendPingInterval = sconfig_temp.SendPingInterval
|
||||
httpobj.http_sconfig.HttpPostInterval = sconfig_temp.HttpPostInterval
|
||||
httpobj.http_sconfig.DampingResistance = sconfig_temp.HttpPostInterval
|
||||
httpobj.http_sconfig.DampingResistance = sconfig_temp.DampingResistance
|
||||
|
||||
SuperParams := mtypes.API_SuperParams{
|
||||
SendPingInterval: httpobj.http_sconfig.SendPingInterval,
|
||||
HttpPostInterval: httpobj.http_sconfig.HttpPostInterval,
|
||||
PeerAliveTimeout: httpobj.http_sconfig.PeerAliveTimeout,
|
||||
DampingResistance: httpobj.http_sconfig.PeerAliveTimeout,
|
||||
DampingResistance: httpobj.http_sconfig.DampingResistance,
|
||||
AdditionalCost: 10,
|
||||
}
|
||||
httpobj.Lock()
|
||||
|
Reference in New Issue
Block a user