The "m" field in the extended handshake is not mandatory
This commit is contained in:
parent
2f8a2ada2e
commit
1b9606ae75
@ -892,11 +892,7 @@ func (c *connection) mainReadLoop() error {
|
||||
if v, ok := d["v"]; ok {
|
||||
c.PeerClientName = v.(string)
|
||||
}
|
||||
m, ok := d["m"]
|
||||
if !ok {
|
||||
err = errors.New("handshake missing m item")
|
||||
break
|
||||
}
|
||||
if m, ok := d["m"]; ok {
|
||||
mTyped, ok := m.(map[string]interface{})
|
||||
if !ok {
|
||||
err = errors.New("handshake m value is not dict")
|
||||
@ -920,6 +916,7 @@ func (c *connection) mainReadLoop() error {
|
||||
c.PeerExtensionIDs[name] = byte(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
metadata_sizeUntyped, ok := d["metadata_size"]
|
||||
if ok {
|
||||
metadata_size, ok := metadata_sizeUntyped.(int64)
|
||||
|
Loading…
x
Reference in New Issue
Block a user