Merge pull request #1370 from lucas-clemente/client-header-parsing

parse headers sent by the server without knowing the version
This commit is contained in:
Marten Seemann
2018-05-29 16:43:52 +08:00
committed by GitHub
8 changed files with 44 additions and 49 deletions

View File

@@ -295,7 +295,7 @@ func (c *client) handlePacket(remoteAddr net.Addr, packet []byte) error {
rcvTime := time.Now()
r := bytes.NewReader(packet)
hdr, err := wire.ParseHeaderSentByServer(r, c.version)
hdr, err := wire.ParseHeaderSentByServer(r)
// drop the packet if we can't parse the header
if err != nil {
return fmt.Errorf("error parsing packet from %s: %s", remoteAddr.String(), err.Error())