protocol: Add "Hello" message at connection start, also for unauthed peers
This commit is contained in:
@@ -11,7 +11,16 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var sha256OfEmptyBlock = sha256.Sum256(make([]byte, BlockSize))
|
||||
var (
|
||||
sha256OfEmptyBlock = sha256.Sum256(make([]byte, BlockSize))
|
||||
HelloMessageMagic uint32 = 0x9F79BC40
|
||||
)
|
||||
|
||||
type HelloMessage struct {
|
||||
DeviceName string // max:64
|
||||
ClientName string // max:64
|
||||
ClientVersion string // max:64
|
||||
}
|
||||
|
||||
type IndexMessage struct {
|
||||
Folder string // max:256
|
||||
@@ -125,11 +134,8 @@ type ResponseMessage struct {
|
||||
}
|
||||
|
||||
type ClusterConfigMessage struct {
|
||||
DeviceName string // max:64
|
||||
ClientName string // max:64
|
||||
ClientVersion string // max:64
|
||||
Folders []Folder // max:1000000
|
||||
Options []Option // max:64
|
||||
Folders []Folder // max:1000000
|
||||
Options []Option // max:64
|
||||
}
|
||||
|
||||
func (o *ClusterConfigMessage) GetOption(key string) string {
|
||||
|
||||
Reference in New Issue
Block a user