mirror of
https://github.com/octoleo/syncthing.git
synced 2025-04-02 07:41:51 +00:00
wip
This commit is contained in:
parent
a5cbe9b48c
commit
06f58812c3
@ -283,13 +283,13 @@ func (m *model) serve(ctx context.Context) error {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
l.Infoln("context closed, stopping", ctx.Err())
|
l.Infoln(m, "context closed, stopping", ctx.Err())
|
||||||
return ctx.Err()
|
return ctx.Err()
|
||||||
case err := <-m.fatalChan:
|
case err := <-m.fatalChan:
|
||||||
l.Infoln("fatal error, stopping", err)
|
l.Infoln(m, "fatal error, stopping", err)
|
||||||
return svcutil.AsFatalErr(err, svcutil.ExitError)
|
return svcutil.AsFatalErr(err, svcutil.ExitError)
|
||||||
case <-m.promotionTimer.C:
|
case <-m.promotionTimer.C:
|
||||||
l.Infoln("promotion timer fired")
|
l.Infoln(m, "promotion timer fired")
|
||||||
m.promoteConnections()
|
m.promoteConnections()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1217,7 +1217,6 @@ func (m *model) ClusterConfig(conn protocol.Connection, cm protocol.ClusterConfi
|
|||||||
if cm.Secondary {
|
if cm.Secondary {
|
||||||
// No handling of secondary connection ClusterConfigs; they merely
|
// No handling of secondary connection ClusterConfigs; they merely
|
||||||
// indicate the connection is ready to start.
|
// indicate the connection is ready to start.
|
||||||
l.Infoln("Ignoring secondary connection cluster-config on connection", conn.ConnectionID())
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,8 +440,6 @@ func (c *rawConnection) readerLoop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *rawConnection) dispatcherLoop() (err error) {
|
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)
|
defer close(c.dispatcherLoopStopped)
|
||||||
var msg message
|
var msg message
|
||||||
state := stateInitial
|
state := stateInitial
|
||||||
@ -963,7 +961,11 @@ func (c *rawConnection) internalClose(err error) {
|
|||||||
}
|
}
|
||||||
c.awaitingMut.Unlock()
|
c.awaitingMut.Unlock()
|
||||||
|
|
||||||
<-c.dispatcherLoopStopped
|
if !c.startTime.IsZero() {
|
||||||
|
// Wait for the dispatcher loop to exit, if it was started to
|
||||||
|
// begin with.
|
||||||
|
<-c.dispatcherLoopStopped
|
||||||
|
}
|
||||||
|
|
||||||
c.model.Closed(err)
|
c.model.Closed(err)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user