mirror of https://bitbucket.org/ausocean/av.git
readFrom() now logs a warning if it is reading a large packet (which I suspect never happens).
This commit is contained in:
parent
828cc3780a
commit
ddd1e4ab17
|
@ -203,12 +203,11 @@ func (pkt *packet) readFrom(c *Conn) error {
|
|||
pkt.resize(pkt.bodySize, (hbuf[0]&0xc0)>>6)
|
||||
}
|
||||
|
||||
sz := c.inChunkSize
|
||||
if pkt.bodySize < sz {
|
||||
sz = pkt.bodySize
|
||||
if pkt.bodySize > c.inChunkSize {
|
||||
c.log(WarnLevel, pkg+"reading large packet", "size", int(pkt.bodySize))
|
||||
}
|
||||
|
||||
_, err = c.read(pkt.body[:sz])
|
||||
_, err = c.read(pkt.body[:pkt.bodySize])
|
||||
if err != nil {
|
||||
c.log(DebugLevel, pkg+"failed to read packet body", "error", err.Error())
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue