We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug CopyFromSocket()函数内部在grow()后可能会把isEmpty错误的置为true,导致PeekAll()时认为是没数据的
To Reproduce Steps to reproduce the behavior:
System Info (please complete the following information):
The text was updated successfully, but these errors were encountered:
CopyFromSocket 哪有调用 Reset()?把你的代码贴出来我看下
CopyFromSocket
Sorry, something went wrong.
CopyFromSocket 哪有调用 Reset()?把你的代码贴出来我看下 问题在把var MaxStreamBufferCap = 64 * 1024改成var MaxStreamBufferCap = 1* 1024后,CopyFromSocket()函数里在计算rb.w时会变成是0,导致第二次调用CopyFromSocket()时调用rb.grow()->rb.Read()->rb.Reset()
以下是自定义的一个ICodec `type testCodec struct { }
func (cc *testCodec) Encode(c gnet.Conn, buf []byte) (out []byte, err error) { return }
func (cc *testCodec) Decode(c gnet.Conn) ([]byte, error) { var buf innerBuffer buf = c.Read() msg, _ := buf.readN(1028) if msg == nil { return nil, nil } c.ShiftN(1028) return msg, nil }`
4569dec
谢谢你发现这个bug。 @zhu121
bug: set the status of ring-buffer to non-empty after it grows its size
c592edd
Fixes panjf2000#288
panjf2000
No branches or pull requests
Describe the bug
CopyFromSocket()函数内部在grow()后可能会把isEmpty错误的置为true,导致PeekAll()时认为是没数据的
To Reproduce
Steps to reproduce the behavior:
System Info (please complete the following information):
The text was updated successfully, but these errors were encountered: