lib: Close underlying conn in protocol (fixes #7165) (#7212)

This commit is contained in:
Simon Frei
2020-12-21 11:40:51 +01:00
committed by GitHub
parent 4a787986cd
commit c845e245a1
11 changed files with 106 additions and 124 deletions
+2 -3
View File
@@ -11,7 +11,6 @@ import (
"net"
"time"
"github.com/syncthing/syncthing/lib/connections"
"github.com/syncthing/syncthing/lib/db"
"github.com/syncthing/syncthing/lib/model"
"github.com/syncthing/syncthing/lib/protocol"
@@ -114,7 +113,7 @@ func (m *mockedModel) ScanFolderSubdirs(folder string, subs []string) error {
func (m *mockedModel) BringToFront(folder, file string) {}
func (m *mockedModel) Connection(deviceID protocol.DeviceID) (connections.Connection, bool) {
func (m *mockedModel) Connection(deviceID protocol.DeviceID) (protocol.Connection, bool) {
return nil, false
}
@@ -165,7 +164,7 @@ func (m *mockedModel) DownloadProgress(deviceID protocol.DeviceID, folder string
return nil
}
func (m *mockedModel) AddConnection(conn connections.Connection, hello protocol.Hello) {}
func (m *mockedModel) AddConnection(conn protocol.Connection, hello protocol.Hello) {}
func (m *mockedModel) OnHello(protocol.DeviceID, net.Addr, protocol.Hello) error {
return nil