mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
all: Fix comment typos
Skip-check: authors GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4481
This commit is contained in:
parent
9245d22f16
commit
7cbd92e1b1
@ -92,7 +92,7 @@ loop:
|
||||
return t1.Sub(t0)
|
||||
}
|
||||
|
||||
// report stops the given process and reports on it's resource usage in two
|
||||
// report stops the given process and reports on its resource usage in two
|
||||
// ways: human readable to stderr, and CSV to stdout.
|
||||
func report(p *rc.Process, wallTime time.Duration) {
|
||||
sv, err := p.SystemVersion()
|
||||
|
@ -189,7 +189,7 @@ done:
|
||||
// We can end up here in 3 cases:
|
||||
// 1. Timeout joining, in which case there are potentially entries in pendingSessions
|
||||
// 2. General session end/timeout, in which case there are entries in activeSessions
|
||||
// 3. Protocol handler calls dropSession as one of it's clients disconnects.
|
||||
// 3. Protocol handler calls dropSession as one of its clients disconnects.
|
||||
|
||||
sessionMut.Lock()
|
||||
delete(pendingSessions, string(s.serverkey))
|
||||
|
@ -227,7 +227,7 @@ next:
|
||||
}
|
||||
|
||||
// If we have a relay connection, and the new incoming connection is
|
||||
// not a relay connection, we should drop that, and prefer the this one.
|
||||
// not a relay connection, we should drop that, and prefer this one.
|
||||
connected := s.model.ConnectedTo(remoteID)
|
||||
s.curConMut.Lock()
|
||||
ct, ok := s.currentConnection[remoteID]
|
||||
|
@ -180,9 +180,9 @@ func (m *cachingMux) Cache() map[protocol.DeviceID]CacheEntry {
|
||||
}
|
||||
}
|
||||
|
||||
// Then ask the finder itself for it's cache and do the same. If this
|
||||
// Then ask the finder itself for its cache and do the same. If this
|
||||
// finder is a global discovery client, it will have no cache. If it's
|
||||
// a local discovery client, this will be it's current state.
|
||||
// a local discovery client, this will be its current state.
|
||||
for k, v := range m.finders[i].Cache() {
|
||||
if v.found {
|
||||
cur := res[k]
|
||||
|
@ -34,7 +34,7 @@ func TestCacheUnique(t *testing.T) {
|
||||
c.(*cachingMux).ServeBackground()
|
||||
defer c.Stop()
|
||||
|
||||
// Add a fake discovery service and verify we get it's answers through the
|
||||
// Add a fake discovery service and verify we get its answers through the
|
||||
// cache.
|
||||
|
||||
f1 := &fakeDiscovery{addresses0}
|
||||
|
@ -1108,7 +1108,7 @@ func (m *Model) handleDeintroductions(introducerCfg config.DeviceConfiguration,
|
||||
if !foldersDevices.has(folderCfg.Devices[i].DeviceID, folderCfg.ID) {
|
||||
// We could not find that folder shared on the
|
||||
// introducer with the device that was introduced to us.
|
||||
// We should follow and unshare aswell.
|
||||
// We should follow and unshare as well.
|
||||
l.Infof("Unsharing folder %s with %v as introducer %v no longer shares the folder with that device", folderCfg.Description(), folderCfg.Devices[i].DeviceID, folderCfg.Devices[i].IntroducedBy)
|
||||
folderCfg.Devices = append(folderCfg.Devices[:i], folderCfg.Devices[i+1:]...)
|
||||
i--
|
||||
|
@ -1908,7 +1908,7 @@ func TestIssue3164(t *testing.T) {
|
||||
func TestIssue4357(t *testing.T) {
|
||||
db := db.OpenMemory()
|
||||
cfg := defaultConfig.RawCopy()
|
||||
// Create a separate wrapper not to polute other tests.
|
||||
// Create a separate wrapper not to pollute other tests.
|
||||
wrapper := config.Wrap("/tmp/test", config.Configuration{})
|
||||
m := NewModel(wrapper, protocol.LocalDeviceID, "syncthing", "dev", db, nil)
|
||||
m.ServeBackground()
|
||||
|
@ -386,7 +386,7 @@ func TestWeakHash(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test that updating a file removes it's old blocks from the blockmap
|
||||
// Test that updating a file removes its old blocks from the blockmap
|
||||
func TestCopierCleanup(t *testing.T) {
|
||||
iterFn := func(folder, file string, index int32) bool {
|
||||
return true
|
||||
|
@ -146,7 +146,7 @@ func (s *sharedPullerState) tempFile() (io.WriterAt, error) {
|
||||
} else if !s.ignorePerms {
|
||||
// With sufficiently bad luck when exiting or crashing, we may have
|
||||
// had time to chmod the temp file to read only state but not yet
|
||||
// moved it to it's final name. This leaves us with a read only temp
|
||||
// moved it to its final name. This leaves us with a read only temp
|
||||
// file that we're going to try to reuse. To handle that, we need to
|
||||
// make sure we have write permissions on the file before opening it.
|
||||
//
|
||||
|
@ -21,7 +21,7 @@ var (
|
||||
|
||||
// An AtomicWriter is an *os.File that writes to a temporary file in the same
|
||||
// directory as the final path. On successful Close the file is renamed to
|
||||
// it's final path. Any error on Write or during Close is accumulated and
|
||||
// its final path. Any error on Write or during Close is accumulated and
|
||||
// returned on Close, so a lazy user can ignore errors until Close.
|
||||
type AtomicWriter struct {
|
||||
path string
|
||||
|
@ -35,9 +35,9 @@ func TryRename(filesystem fs.Filesystem, from, to string) error {
|
||||
})
|
||||
}
|
||||
|
||||
// Rename moves a temporary file to it's final place.
|
||||
// Rename moves a temporary file to its final place.
|
||||
// Will make sure to delete the from file if the operation fails, so use only
|
||||
// for situations like committing a temp file to it's final location.
|
||||
// for situations like committing a temp file to its final location.
|
||||
// Tries hard to succeed on various systems by temporarily tweaking directory
|
||||
// permissions and removing the destination file when necessary.
|
||||
func Rename(filesystem fs.Filesystem, from, to string) error {
|
||||
@ -114,7 +114,7 @@ func withPreparedTarget(filesystem fs.Filesystem, from, to string, f func() erro
|
||||
|
||||
// copyFileContents copies the contents of the file named src to the file named
|
||||
// by dst. The file will be created if it does not already exist. If the
|
||||
// destination file exists, all it's contents will be replaced by the contents
|
||||
// destination file exists, all its contents will be replaced by the contents
|
||||
// of the source file.
|
||||
func copyFileContents(filesystem fs.Filesystem, src, dst string) (err error) {
|
||||
in, err := filesystem.Open(src)
|
||||
|
@ -127,7 +127,7 @@ type message interface {
|
||||
|
||||
type asyncMessage struct {
|
||||
msg message
|
||||
done chan struct{} // done closes when we're done marshalling the message and it's contents can be reused
|
||||
done chan struct{} // done closes when we're done marshalling the message and its contents can be reused
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -348,7 +348,7 @@ func TestConflictsIndexReset(t *testing.T) {
|
||||
|
||||
log.Println("Updating...")
|
||||
|
||||
// change s2/file2 a few times, so that it's version counter increases.
|
||||
// change s2/file2 a few times, so that its version counter increases.
|
||||
// This will make the file on the cluster look newer than what we have
|
||||
// locally after we rest the index, unless we have a fix for that.
|
||||
|
||||
|
@ -258,7 +258,7 @@ func testSyncCluster(t *testing.T) {
|
||||
break
|
||||
}
|
||||
|
||||
// Alter the "test-appendfile" without changing it's modification time. Sneaky!
|
||||
// Alter the "test-appendfile" without changing its modification time. Sneaky!
|
||||
fi, err := os.Stat("s1/test-appendfile")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
Loading…
Reference in New Issue
Block a user