mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
Flag checking is now responsibility of the model
This commit is contained in:
parent
1cb5875b20
commit
fdf15f3ca3
@ -287,11 +287,6 @@ func (c *rawConnection) readerLoop() (err error) {
|
|||||||
|
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case IndexMessage:
|
case IndexMessage:
|
||||||
if msg.Flags != 0 {
|
|
||||||
// We don't currently support or expect any flags.
|
|
||||||
return fmt.Errorf("protocol error: unknown flags 0x%x in Index(Update) message", msg.Flags)
|
|
||||||
}
|
|
||||||
|
|
||||||
switch hdr.msgType {
|
switch hdr.msgType {
|
||||||
case messageTypeIndex:
|
case messageTypeIndex:
|
||||||
if c.state < stateCCRcvd {
|
if c.state < stateCCRcvd {
|
||||||
@ -308,10 +303,6 @@ func (c *rawConnection) readerLoop() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case RequestMessage:
|
case RequestMessage:
|
||||||
if msg.Flags != 0 {
|
|
||||||
// We don't currently support or expect any flags.
|
|
||||||
return fmt.Errorf("protocol error: unknown flags 0x%x in Request message", msg.Flags)
|
|
||||||
}
|
|
||||||
if c.state < stateIdxRcvd {
|
if c.state < stateIdxRcvd {
|
||||||
return fmt.Errorf("protocol error: request message in state %d", c.state)
|
return fmt.Errorf("protocol error: request message in state %d", c.state)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user