mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
lib/connections: Silence vet and lint warnings
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2971
This commit is contained in:
parent
19b4f3bfb4
commit
52c7804f32
@ -15,7 +15,6 @@ import (
|
|||||||
"github.com/syndtr/goleveldb/leveldb"
|
"github.com/syndtr/goleveldb/leveldb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An IntHeap is a min-heap of ints.
|
|
||||||
type SizedElement struct {
|
type SizedElement struct {
|
||||||
key string
|
key string
|
||||||
size int
|
size int
|
||||||
|
@ -199,7 +199,10 @@ func (s *apiService) getListener(guiCfg config.GUIConfiguration) (net.Listener,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
listener := &tlsutil.DowngradingListener{rawListener, tlsCfg}
|
listener := &tlsutil.DowngradingListener{
|
||||||
|
Listener: rawListener,
|
||||||
|
TLSConfig: tlsCfg,
|
||||||
|
}
|
||||||
return listener, nil
|
return listener, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,9 +268,9 @@ next:
|
|||||||
|
|
||||||
s.mut.Lock()
|
s.mut.Lock()
|
||||||
s.model.AddConnection(model.Connection{
|
s.model.AddConnection(model.Connection{
|
||||||
c,
|
Conn: c,
|
||||||
protoConn,
|
Connection: protoConn,
|
||||||
c.Type,
|
Type: c.Type,
|
||||||
}, hello)
|
}, hello)
|
||||||
s.connType[remoteID] = c.Type
|
s.connType[remoteID] = c.Type
|
||||||
s.mut.Unlock()
|
s.mut.Unlock()
|
||||||
@ -319,7 +319,8 @@ func (s *Service) connect() {
|
|||||||
s.model.Close(deviceID, fmt.Errorf("switching connections"))
|
s.model.Close(deviceID, fmt.Errorf("switching connections"))
|
||||||
}
|
}
|
||||||
s.conns <- model.IntermediateConnection{
|
s.conns <- model.IntermediateConnection{
|
||||||
conn, model.ConnectionTypeDirectDial,
|
Conn: conn,
|
||||||
|
Type: model.ConnectionTypeDirectDial,
|
||||||
}
|
}
|
||||||
continue nextDevice
|
continue nextDevice
|
||||||
}
|
}
|
||||||
@ -350,7 +351,8 @@ func (s *Service) connect() {
|
|||||||
if conn := s.connectViaRelay(deviceID, addr); conn != nil {
|
if conn := s.connectViaRelay(deviceID, addr); conn != nil {
|
||||||
l.Debugln("Connecting to", deviceID, "via", addr, "succeeded")
|
l.Debugln("Connecting to", deviceID, "via", addr, "succeeded")
|
||||||
s.conns <- model.IntermediateConnection{
|
s.conns <- model.IntermediateConnection{
|
||||||
conn, model.ConnectionTypeRelayDial,
|
Conn: conn,
|
||||||
|
Type: model.ConnectionTypeRelayDial,
|
||||||
}
|
}
|
||||||
continue nextDevice
|
continue nextDevice
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,8 @@ func makeTCPListener(network string) ListenerFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
conns <- model.IntermediateConnection{
|
conns <- model.IntermediateConnection{
|
||||||
tc, model.ConnectionTypeDirectAccept,
|
Conn: tc,
|
||||||
|
Type: model.ConnectionTypeDirectAccept,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user