mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-09 17:53:59 +00:00
commit
c39f2b7c05
@ -31,7 +31,7 @@ import (
|
|||||||
// If all verification calls returns nil, CommitConfiguration() is called for
|
// If all verification calls returns nil, CommitConfiguration() is called for
|
||||||
// each subscribing object. The callee returns true if the new configuration
|
// each subscribing object. The callee returns true if the new configuration
|
||||||
// has been successfully applied, otherwise false. Any Commit() call returning
|
// has been successfully applied, otherwise false. Any Commit() call returning
|
||||||
// false will result in a "restart needed" respone to the API/user. Note that
|
// false will result in a "restart needed" response to the API/user. Note that
|
||||||
// the new configuration will still have been applied by those who were
|
// the new configuration will still have been applied by those who were
|
||||||
// capable of doing so.
|
// capable of doing so.
|
||||||
type Committer interface {
|
type Committer interface {
|
||||||
|
@ -389,7 +389,7 @@ func (s *connectionSvc) connectViaRelay(deviceID protocol.DeviceID, addr discove
|
|||||||
l.Debugf("Failed to join relay session %s: %v", inv, err)
|
l.Debugf("Failed to join relay session %s: %v", inv, err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
l.Debugln("Sucessfully joined relay session", inv)
|
l.Debugln("Successfully joined relay session", inv)
|
||||||
|
|
||||||
var tc *tls.Conn
|
var tc *tls.Conn
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ func (r *VirtualMtimeRepo) UpdateMtime(path string, diskMtime, actualMtime time.
|
|||||||
func (r *VirtualMtimeRepo) GetMtime(path string, diskMtime time.Time) time.Time {
|
func (r *VirtualMtimeRepo) GetMtime(path string, diskMtime time.Time) time.Time {
|
||||||
data, exists := r.ns.Bytes(path)
|
data, exists := r.ns.Bytes(path)
|
||||||
if !exists {
|
if !exists {
|
||||||
// Absense of debug print is significant enough in itself here
|
// Absence of debug print is significant enough in itself here
|
||||||
return diskMtime
|
return diskMtime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ connection addresses (if any) and relay addresses (if any).
|
|||||||
}
|
}
|
||||||
|
|
||||||
It's OK for either of the "direct" or "relays" fields to be either the empty
|
It's OK for either of the "direct" or "relays" fields to be either the empty
|
||||||
list ([]), null, or missing entirely. An announcment with both fields missing
|
list ([]), null, or missing entirely. An announcement with both fields missing
|
||||||
or empty is however not useful...
|
or empty is however not useful...
|
||||||
|
|
||||||
Any empty or unspecified IP addresses (i.e. addresses like tcp://:22000,
|
Any empty or unspecified IP addresses (i.e. addresses like tcp://:22000,
|
||||||
@ -39,7 +39,7 @@ The server response is empty, with code 200 (OK) on success. If no certificate
|
|||||||
was presented, status 403 (Forbidden) is returned. If the posted data doesn't
|
was presented, status 403 (Forbidden) is returned. If the posted data doesn't
|
||||||
conform to the expected format, 400 (Bad Request) is returned.
|
conform to the expected format, 400 (Bad Request) is returned.
|
||||||
|
|
||||||
In successfull responses, the server may return a "Reannounce-After" header
|
In successful responses, the server may return a "Reannounce-After" header
|
||||||
containing the number of seconds after which the client should perform a new
|
containing the number of seconds after which the client should perform a new
|
||||||
announcement.
|
announcement.
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ Queries are performed as HTTPS GET requests to the announce server URL. The
|
|||||||
requested device ID is passed as the query parameter "device", in canonical
|
requested device ID is passed as the query parameter "device", in canonical
|
||||||
string form, i.e. https://announce.syncthing.net/?device=ABC12345-....
|
string form, i.e. https://announce.syncthing.net/?device=ABC12345-....
|
||||||
|
|
||||||
Successfull responses will have status code 200 (OK) and carry a JSON payload
|
Successful responses will have status code 200 (OK) and carry a JSON payload
|
||||||
of the same format as the announcement above. The response will not contain
|
of the same format as the announcement above. The response will not contain
|
||||||
empty or unspecified addresses.
|
empty or unspecified addresses.
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ func (s *BufferedSubscription) Since(id int, into []Event) []Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Error returns a string pointer suitable for JSON marshalling errors. It
|
// Error returns a string pointer suitable for JSON marshalling errors. It
|
||||||
// retains the "null on sucess" semantics, but ensures the error result is a
|
// retains the "null on success" semantics, but ensures the error result is a
|
||||||
// string regardless of the underlying concrete error type.
|
// string regardless of the underlying concrete error type.
|
||||||
func Error(err error) *string {
|
func Error(err error) *string {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -78,7 +78,7 @@ func TestFacilityDebugging(t *testing.T) {
|
|||||||
f1.Debugln("Debug line from f1")
|
f1.Debugln("Debug line from f1")
|
||||||
|
|
||||||
if msgs != 1 {
|
if msgs != 1 {
|
||||||
t.Fatalf("Incorrent number of messages, %d != 1", msgs)
|
t.Fatalf("Incorrect number of messages, %d != 1", msgs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1014,7 +1014,7 @@ func sendIndexes(conn protocol.Connection, folder string, fs *db.FileSet, ignore
|
|||||||
minLocalVer, err = sendIndexTo(false, minLocalVer, conn, folder, fs, ignores)
|
minLocalVer, err = sendIndexTo(false, minLocalVer, conn, folder, fs, ignores)
|
||||||
|
|
||||||
// Wait a short amount of time before entering the next loop. If there
|
// Wait a short amount of time before entering the next loop. If there
|
||||||
// are continous changes happening to the local index, this gives us
|
// are continuous changes happening to the local index, this gives us
|
||||||
// time to batch them up a little.
|
// time to batch them up a little.
|
||||||
time.Sleep(250 * time.Millisecond)
|
time.Sleep(250 * time.Millisecond)
|
||||||
}
|
}
|
||||||
@ -1848,7 +1848,7 @@ func (m *Model) CommitConfiguration(from, to config.Configuration) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removing a device requres restart
|
// Removing a device requires restart
|
||||||
toDevs := mapDeviceCfgs(from.Devices)
|
toDevs := mapDeviceCfgs(from.Devices)
|
||||||
for _, dev := range from.Devices {
|
for _, dev := range from.Devices {
|
||||||
if _, ok := toDevs[dev.DeviceID]; !ok {
|
if _, ok := toDevs[dev.DeviceID]; !ok {
|
||||||
|
@ -514,7 +514,7 @@ func TestDeregisterOnFailInPull(t *testing.T) {
|
|||||||
|
|
||||||
p.handleFile(file, copyChan, finisherChan)
|
p.handleFile(file, copyChan, finisherChan)
|
||||||
|
|
||||||
// Receove at finisher, we shoud error out as puller has nowhere to pull
|
// Receive at finisher, we should error out as puller has nowhere to pull
|
||||||
// from.
|
// from.
|
||||||
select {
|
select {
|
||||||
case state := <-finisherBufferChan:
|
case state := <-finisherBufferChan:
|
||||||
|
@ -47,7 +47,7 @@ func TestGetIndex(t *testing.T) {
|
|||||||
p := startInstance(t, 2)
|
p := startInstance(t, 2)
|
||||||
defer checkedStop(t, p)
|
defer checkedStop(t, p)
|
||||||
|
|
||||||
// Check for explicint index.html
|
// Check for explicit index.html
|
||||||
|
|
||||||
res, err := http.Get("http://localhost:8082/index.html")
|
res, err := http.Get("http://localhost:8082/index.html")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -220,7 +220,7 @@ func alterFiles(dir string) error {
|
|||||||
/*
|
/*
|
||||||
This fails. Bug?
|
This fails. Bug?
|
||||||
|
|
||||||
// Rename the file, while potentially moving it up in the directory hiearachy
|
// Rename the file, while potentially moving it up in the directory hierarchy
|
||||||
case r == 4 && comps > 2 && (info.Mode().IsRegular() || rand.Float64() < 0.2):
|
case r == 4 && comps > 2 && (info.Mode().IsRegular() || rand.Float64() < 0.2):
|
||||||
rpath := filepath.Dir(path)
|
rpath := filepath.Dir(path)
|
||||||
if rand.Float64() < 0.2 {
|
if rand.Float64() < 0.2 {
|
||||||
|
Loading…
Reference in New Issue
Block a user