mirror of
https://github.com/octoleo/syncthing.git
synced 2025-04-01 23:31:53 +00:00
Prevent possible reordering of Index/IndexUpdate on send (ref #344)
This commit is contained in:
parent
de382e33a3
commit
66d4e9e5d7
@ -165,10 +165,12 @@ func (c *rawConnection) Index(repo string, idx []FileInfo) {
|
|||||||
}
|
}
|
||||||
idx = diff
|
idx = diff
|
||||||
}
|
}
|
||||||
c.imut.Unlock()
|
|
||||||
|
|
||||||
|
if len(idx) > 0 {
|
||||||
c.send(header{0, -1, msgType}, IndexMessage{repo, idx})
|
c.send(header{0, -1, msgType}, IndexMessage{repo, idx})
|
||||||
}
|
}
|
||||||
|
c.imut.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
// Request returns the bytes for the specified block after fetching them from the connected peer.
|
// Request returns the bytes for the specified block after fetching them from the connected peer.
|
||||||
func (c *rawConnection) Request(repo string, name string, offset int64, size int) ([]byte, error) {
|
func (c *rawConnection) Request(repo string, name string, offset int64, size int) ([]byte, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user