mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-06-15 15:36:06 +00:00
Fix Read, update sample
This commit is contained in:
@ -88,8 +88,10 @@ func (c *Conn) Read(b []byte) (int, error) {
|
||||
util.PutBytes(bs)
|
||||
return errors.New("packet dropped due to decryption failure")
|
||||
}
|
||||
b = b[:0]
|
||||
b = append(b, bs...)
|
||||
copy(b, bs)
|
||||
if len(bs) < len(b) {
|
||||
b = b[:len(bs)]
|
||||
}
|
||||
c.session.updateNonce(&p.Nonce)
|
||||
c.session.time = time.Now()
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user