add rcv_bufsize on kcp_setting to allow recv larger package#790
Merged
ithewei merged 1 commit intoithewei:masterfrom Jan 15, 2026
Merged
add rcv_bufsize on kcp_setting to allow recv larger package#790ithewei merged 1 commit intoithewei:masterfrom
ithewei merged 1 commit intoithewei:masterfrom
Conversation
ithewei
reviewed
Dec 9, 2025
| // NOTE: alloc kcp->readbuf now, otherwise hio_read_kcp will use default size (DEFAULT_KCP_READ_BUFSIZE) | ||
| if (setting->rcv_bufsize > 0) { | ||
| kcp->readbuf.len = setting->rcv_bufsize; | ||
| HV_ALLOC(kcp->readbuf.base, kcp->readbuf.len); |
Owner
There was a problem hiding this comment.
Maybe you shoud use hio_alloc_readbuf,and hio_free_readbuf is called when hio_done.
Contributor
Author
There was a problem hiding this comment.
Maybe you shoud use hio_alloc_readbuf,and hio_free_readbuf is called when hio_done.
HV_FREE already used in kcp_release(which will be called in hio_close -> hio_done ->rudp_cleanup->rudp_entry_free), so I called HV_ALLOC here
Owner
There was a problem hiding this comment.
OK, I've reviewed it again, and the readbuf here is kcp_s own readbuf, unrelated to hio_s, and can be allocated here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I add a member to kcp_setting_t so that it can allow recv larger package in kcp session.
I wonder whether it's reasonable or not, or larger package will rersult in some performace matter(maybe that's why it's not supported before)?