mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 15:20:56 +00:00
lib/model: Remove legacy handling of symlinks (#6276)
This hardly seams relevant any more; 0.14.14 is dead since a long time.
This commit is contained in:
parent
39891cdf42
commit
6c8e8f0391
@ -34,7 +34,6 @@ import (
|
|||||||
"github.com/syncthing/syncthing/lib/scanner"
|
"github.com/syncthing/syncthing/lib/scanner"
|
||||||
"github.com/syncthing/syncthing/lib/stats"
|
"github.com/syncthing/syncthing/lib/stats"
|
||||||
"github.com/syncthing/syncthing/lib/sync"
|
"github.com/syncthing/syncthing/lib/sync"
|
||||||
"github.com/syncthing/syncthing/lib/upgrade"
|
|
||||||
"github.com/syncthing/syncthing/lib/util"
|
"github.com/syncthing/syncthing/lib/util"
|
||||||
"github.com/syncthing/syncthing/lib/versioner"
|
"github.com/syncthing/syncthing/lib/versioner"
|
||||||
)
|
)
|
||||||
@ -1120,7 +1119,6 @@ func (m *model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
|
|||||||
m.pmut.RLock()
|
m.pmut.RLock()
|
||||||
conn, ok := m.conn[deviceID]
|
conn, ok := m.conn[deviceID]
|
||||||
closed := m.closed[deviceID]
|
closed := m.closed[deviceID]
|
||||||
hello := m.helloMessages[deviceID]
|
|
||||||
m.pmut.RUnlock()
|
m.pmut.RUnlock()
|
||||||
if !ok {
|
if !ok {
|
||||||
panic("bug: ClusterConfig called on closed or nonexistent connection")
|
panic("bug: ClusterConfig called on closed or nonexistent connection")
|
||||||
@ -1129,14 +1127,6 @@ func (m *model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
|
|||||||
changed := false
|
changed := false
|
||||||
deviceCfg := m.cfg.Devices()[deviceID]
|
deviceCfg := m.cfg.Devices()[deviceID]
|
||||||
|
|
||||||
// See issue #3802 - in short, we can't send modern symlink entries to older
|
|
||||||
// clients.
|
|
||||||
dropSymlinks := false
|
|
||||||
if hello.ClientName == m.clientName && upgrade.CompareVersions(hello.ClientVersion, "v0.14.14") < 0 {
|
|
||||||
l.Warnln("Not sending symlinks to old client", deviceID, "- please upgrade to v0.14.14 or newer")
|
|
||||||
dropSymlinks = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Needs to happen outside of the fmut, as can cause CommitConfiguration
|
// Needs to happen outside of the fmut, as can cause CommitConfiguration
|
||||||
if deviceCfg.AutoAcceptFolders {
|
if deviceCfg.AutoAcceptFolders {
|
||||||
for _, folder := range cm.Folders {
|
for _, folder := range cm.Folders {
|
||||||
@ -1257,7 +1247,6 @@ func (m *model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
|
|||||||
folder: folder.ID,
|
folder: folder.ID,
|
||||||
fset: fs,
|
fset: fs,
|
||||||
prevSequence: startSequence,
|
prevSequence: startSequence,
|
||||||
dropSymlinks: dropSymlinks,
|
|
||||||
evLogger: m.evLogger,
|
evLogger: m.evLogger,
|
||||||
}
|
}
|
||||||
is.Service = util.AsService(is.serve, is.String())
|
is.Service = util.AsService(is.serve, is.String())
|
||||||
@ -2005,7 +1994,6 @@ type indexSender struct {
|
|||||||
dev string
|
dev string
|
||||||
fset *db.FileSet
|
fset *db.FileSet
|
||||||
prevSequence int64
|
prevSequence int64
|
||||||
dropSymlinks bool
|
|
||||||
evLogger events.Logger
|
evLogger events.Logger
|
||||||
connClosed chan struct{}
|
connClosed chan struct{}
|
||||||
}
|
}
|
||||||
@ -2113,14 +2101,6 @@ func (s *indexSender) sendIndexTo(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
f.LocalFlags = 0 // never sent externally
|
f.LocalFlags = 0 // never sent externally
|
||||||
|
|
||||||
if s.dropSymlinks && f.IsSymlink() {
|
|
||||||
// Do not send index entries with symlinks to clients that can't
|
|
||||||
// handle it. Fixes issue #3802. Once both sides are upgraded, a
|
|
||||||
// rescan (i.e., change) of the symlink is required for it to
|
|
||||||
// sync again, due to delta indexes.
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
batch.append(f)
|
batch.append(f)
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user