Repository: syncthing/syncthing (language: go)

Issue:
Spurious failure of new connections ("unknown (newer?) version of the protocol" etc)
https://forum.syncthing.net/t/the-remote-device-speaks-an-unknown-newer-version-of-the-protocol-when-connecting-between-v1-20-0-and-v1-19-2/18390/10


Discussion / hints:

Fix patch:
diff --git a/lib/connections/service.go b/lib/connections/service.go
index 1404b963527..ace5dd0c405 100644
--- a/lib/connections/service.go
+++ b/lib/connections/service.go
@@ -228,8 +228,8 @@ func NewService(cfg config.Wrapper, myID protocol.DeviceID, mdl Model, tlsCfg *t
 }
 
 func (s *service) handleConns(ctx context.Context) error {
-	var c internalConn
 	for {
+		var c internalConn
 		select {
 		case <-ctx.Done():
 			return ctx.Err()


Test patch: