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
void TcpBuffer::recycleWrite(int index) { int j = m_write_index + index; //TODO: here get a bug if (j >= (int)m_buffer.size()) { ErrorLog << "recycleWrite error"; return; } m_write_index = j; adjustBuffer(); }
此处是否有bug,当buffer被填满时,例如 [2022-05-18 03:04:04.214972] [DEBUG] [29062] [29064] [1] [tinyrpc/net/tcp/tcp_connection.cc:114] m_read_buffer size=128rd=0wd=0 [2022-05-18 03:04:04.214988] [DEBUG] [29062] [29064] [1] [tinyrpc/coroutine/coroutine_hook.cc:55] this is hook read [2022-05-18 03:04:04.214998] [DEBUG] [29062] [29064] [1] [tinyrpc/net/fd_event.cc:121] fd already set o_nonblock [2022-05-18 03:04:04.215017] [DEBUG] [29062] [29064] [1] [tinyrpc/net/tcp/tcp_connection.cc:116] read_hook func get size: 128 此时读到了128个byte,但是在调用recycleWrite时,由于0+128 >= 128而导致返回,引发后续错误
The text was updated successfully, but these errors were encountered:
好的,感谢反馈。我尽快修复一下。或者你也可以修复,我再帮你合并下
Sorry, something went wrong.
No branches or pull requests
此处是否有bug,当buffer被填满时,例如
[2022-05-18 03:04:04.214972] [DEBUG] [29062] [29064] [1] [tinyrpc/net/tcp/tcp_connection.cc:114] m_read_buffer size=128rd=0wd=0
[2022-05-18 03:04:04.214988] [DEBUG] [29062] [29064] [1] [tinyrpc/coroutine/coroutine_hook.cc:55] this is hook read
[2022-05-18 03:04:04.214998] [DEBUG] [29062] [29064] [1] [tinyrpc/net/fd_event.cc:121] fd already set o_nonblock
[2022-05-18 03:04:04.215017] [DEBUG] [29062] [29064] [1] [tinyrpc/net/tcp/tcp_connection.cc:116] read_hook func get size: 128
此时读到了128个byte,但是在调用recycleWrite时,由于0+128 >= 128而导致返回,引发后续错误
The text was updated successfully, but these errors were encountered: