mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
Fix Read, update sample
This commit is contained in:
parent
693bcc5713
commit
24281d4049
2 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue