From 7f0593cd2d5e6d1b8fc64ebbf6473442f5b2650f Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 9 May 2015 22:17:53 +0200 Subject: [PATCH] Set default UPnP lease time to 60 minutes --- internal/config/config.go | 2 +- internal/config/config_test.go | 4 ++-- internal/config/testdata/overridenvalues.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 77849b0eb..3b2eea8a6 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -228,7 +228,7 @@ type OptionsConfiguration struct { ReconnectIntervalS int `xml:"reconnectionIntervalS" json:"reconnectionIntervalS" default:"60"` StartBrowser bool `xml:"startBrowser" json:"startBrowser" default:"true"` UPnPEnabled bool `xml:"upnpEnabled" json:"upnpEnabled" default:"true"` - UPnPLeaseM int `xml:"upnpLeaseMinutes" json:"upnpLeaseMinutes" default:"0"` + UPnPLeaseM int `xml:"upnpLeaseMinutes" json:"upnpLeaseMinutes" default:"60"` UPnPRenewalM int `xml:"upnpRenewalMinutes" json:"upnpRenewalMinutes" default:"30"` UPnPTimeoutS int `xml:"upnpTimeoutSeconds" json:"upnpTimeoutSeconds" default:"10"` URAccepted int `xml:"urAccepted" json:"urAccepted"` // Accepted usage reporting version; 0 for off (undecided), -1 for off (permanently) diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 048a85dfc..4e02897dd 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -42,7 +42,7 @@ func TestDefaultValues(t *testing.T) { ReconnectIntervalS: 60, StartBrowser: true, UPnPEnabled: true, - UPnPLeaseM: 0, + UPnPLeaseM: 60, UPnPRenewalM: 30, UPnPTimeoutS: 10, RestartOnWakeup: true, @@ -148,7 +148,7 @@ func TestOverriddenValues(t *testing.T) { ReconnectIntervalS: 6000, StartBrowser: false, UPnPEnabled: false, - UPnPLeaseM: 60, + UPnPLeaseM: 90, UPnPRenewalM: 15, UPnPTimeoutS: 15, RestartOnWakeup: false, diff --git a/internal/config/testdata/overridenvalues.xml b/internal/config/testdata/overridenvalues.xml index 1730a795d..3dac47b78 100755 --- a/internal/config/testdata/overridenvalues.xml +++ b/internal/config/testdata/overridenvalues.xml @@ -13,7 +13,7 @@ 6000 false false - 60 + 90 15 15 false