Remove KCP (fixes #4737) (#4741)

This commit is contained in:
Jakob Borg
2018-02-09 11:40:57 +01:00
committed by GitHub
parent 97068c10f3
commit b97d5bcca8
54 changed files with 268 additions and 6169 deletions

View File

@@ -68,13 +68,6 @@ func TestDefaultValues(t *testing.T) {
TempIndexMinBlocks: 10,
UnackedNotificationIDs: []string{},
WeakHashSelectionMethod: WeakHashAuto,
StunKeepaliveS: 24,
StunServers: []string{"default"},
KCPCongestionControl: true,
KCPReceiveWindowSize: 128,
KCPSendWindowSize: 128,
KCPUpdateIntervalMs: 25,
KCPFastResend: false,
DefaultFolderPath: "~",
SetLowPriority: true,
}
@@ -217,13 +210,6 @@ func TestOverriddenValues(t *testing.T) {
"channelNotification", // added in 17->18 migration
},
WeakHashSelectionMethod: WeakHashNever,
StunKeepaliveS: 10,
StunServers: []string{"a.stun.com", "b.stun.com"},
KCPCongestionControl: false,
KCPReceiveWindowSize: 1280,
KCPSendWindowSize: 1280,
KCPUpdateIntervalMs: 1000,
KCPFastResend: true,
DefaultFolderPath: "/media/syncthing",
SetLowPriority: false,
}
@@ -953,6 +939,32 @@ func TestInvalidFolderIDRejected(t *testing.T) {
}
}
func TestFilterURLSchemePrefix(t *testing.T) {
cases := []struct {
before []string
prefix string
after []string
}{
{[]string{}, "kcp", []string{}},
{[]string{"tcp://foo"}, "kcp", []string{"tcp://foo"}},
{[]string{"kcp://foo"}, "kcp", []string{}},
{[]string{"tcp6://foo", "kcp6://foo"}, "kcp", []string{"tcp6://foo"}},
{[]string{"kcp6://foo", "tcp6://foo"}, "kcp", []string{"tcp6://foo"}},
{
[]string{"tcp://foo", "tcp4://foo", "kcp://foo", "kcp4://foo", "banana://foo", "banana4://foo", "banananas!"},
"kcp",
[]string{"tcp://foo", "tcp4://foo", "banana://foo", "banana4://foo", "banananas!"},
},
}
for _, tc := range cases {
res := filterURLSchemePrefix(tc.before, tc.prefix)
if !reflect.DeepEqual(res, tc.after) {
t.Errorf("filterURLSchemePrefix => %q, expected %q", res, tc.after)
}
}
}
// defaultConfigAsMap returns a valid default config as a JSON-decoded
// map[string]interface{}. This is useful to override random elements and
// re-encode into JSON.