mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 19:08:58 +00:00
lib/protocol: Eliminate nativeModel on Unix
This commit is contained in:
parent
cb607e8551
commit
46082f194c
@ -9,6 +9,8 @@ package protocol
|
|||||||
|
|
||||||
import "golang.org/x/text/unicode/norm"
|
import "golang.org/x/text/unicode/norm"
|
||||||
|
|
||||||
|
func makeNative(m Model) Model { return nativeModel{m} }
|
||||||
|
|
||||||
type nativeModel struct {
|
type nativeModel struct {
|
||||||
Model
|
Model
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,4 @@ package protocol
|
|||||||
|
|
||||||
// Normal Unixes uses NFC and slashes, which is the wire format.
|
// Normal Unixes uses NFC and slashes, which is the wire format.
|
||||||
|
|
||||||
type nativeModel struct {
|
func makeNative(m Model) Model { return m }
|
||||||
Model
|
|
||||||
}
|
|
||||||
|
@ -13,6 +13,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func makeNative(m Model) Model { return nativeModel{m} }
|
||||||
|
|
||||||
type nativeModel struct {
|
type nativeModel struct {
|
||||||
Model
|
Model
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ var CloseTimeout = 10 * time.Second
|
|||||||
func NewConnection(deviceID DeviceID, reader io.Reader, writer io.Writer, closer io.Closer, receiver Model, connInfo ConnectionInfo, compress Compression, passwords map[string]string) Connection {
|
func NewConnection(deviceID DeviceID, reader io.Reader, writer io.Writer, closer io.Closer, receiver Model, connInfo ConnectionInfo, compress Compression, passwords map[string]string) Connection {
|
||||||
// Encryption / decryption is first (outermost) before conversion to
|
// Encryption / decryption is first (outermost) before conversion to
|
||||||
// native path formats.
|
// native path formats.
|
||||||
nm := nativeModel{receiver}
|
nm := makeNative(receiver)
|
||||||
em := &encryptedModel{model: nm, folderKeys: newFolderKeyRegistry(passwords)}
|
em := &encryptedModel{model: nm, folderKeys: newFolderKeyRegistry(passwords)}
|
||||||
|
|
||||||
// We do the wire format conversion first (outermost) so that the
|
// We do the wire format conversion first (outermost) so that the
|
||||||
|
Loading…
Reference in New Issue
Block a user