mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
wip
This commit is contained in:
parent
734a8f5dee
commit
13742e6f09
@ -3096,13 +3096,6 @@ func (m *model) CommitConfiguration(from, to config.Configuration) bool {
|
||||
}
|
||||
}
|
||||
|
||||
// Removing a device. We actually don't need to do anything.
|
||||
// Because folder config has changed (since the device lists do not match)
|
||||
// Folders for that had device got "restarted", which involves killing
|
||||
// connections to all devices that we were sharing the folder with.
|
||||
// At some point model.Close() will get called for that device which will
|
||||
// clean residue device state that is not part of any folder.
|
||||
|
||||
// Pausing a device, unpausing is handled by the connection service.
|
||||
fromDevices := from.DeviceMap()
|
||||
toDevices := to.DeviceMap()
|
||||
@ -3138,6 +3131,7 @@ func (m *model) CommitConfiguration(from, to config.Configuration) bool {
|
||||
m.setConnRequestLimiters(toCfg)
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up after removed devices
|
||||
removedDevices := make([]protocol.DeviceID, 0, len(fromDevices))
|
||||
m.fmut.Lock()
|
||||
|
@ -34,6 +34,7 @@ import (
|
||||
"github.com/syncthing/syncthing/lib/osutil"
|
||||
"github.com/syncthing/syncthing/lib/protocol"
|
||||
protocolmocks "github.com/syncthing/syncthing/lib/protocol/mocks"
|
||||
"github.com/syncthing/syncthing/lib/rand"
|
||||
srand "github.com/syncthing/syncthing/lib/rand"
|
||||
"github.com/syncthing/syncthing/lib/testutils"
|
||||
"github.com/syncthing/syncthing/lib/util"
|
||||
@ -2964,7 +2965,9 @@ func TestConnCloseOnRestart(t *testing.T) {
|
||||
|
||||
br := &testutils.BlockingRW{}
|
||||
nw := &testutils.NoopRW{}
|
||||
m.AddConnection(protocol.NewConnection(device1, br, nw, testutils.NoopCloser{}, m, new(protocolmocks.ConnectionInfo), protocol.CompressionNever, nil, m.keyGen), protocol.Hello{})
|
||||
ci := &protocolmocks.ConnectionInfo{}
|
||||
ci.ConnectionIDReturns(rand.String(16))
|
||||
m.AddConnection(protocol.NewConnection(device1, br, nw, testutils.NoopCloser{}, m, ci, protocol.CompressionNever, nil, m.keyGen), protocol.Hello{})
|
||||
m.pmut.RLock()
|
||||
if len(m.closed) != 1 {
|
||||
t.Fatalf("Expected just one conn (len(m.closed) == %v)", len(m.closed))
|
||||
|
@ -440,6 +440,8 @@ func (c *rawConnection) readerLoop() {
|
||||
}
|
||||
|
||||
func (c *rawConnection) dispatcherLoop() (err error) {
|
||||
l.Infof("dispatcher loop started: %v", err)
|
||||
defer l.Infof("dispatcher loop stopped: %v", err)
|
||||
defer close(c.dispatcherLoopStopped)
|
||||
var msg message
|
||||
state := stateInitial
|
||||
|
Loading…
Reference in New Issue
Block a user