Open kratkyzobak opened 3 weeks ago
The recent changes focus on enhancing project documentation and modifying buffer management within the code. Jakub Adamus has been added to the AUTHORS
file to acknowledge his contributions. Additionally, the writeAuthSwitchPacket
method in packets.go
has been updated to use a different buffer acquisition method, potentially improving memory management and packet construction during authentication processes.
File | Change Summary |
---|---|
AUTHORS | Added Jakub Adamus as a contributor. |
packets.go | Modified writeAuthSwitchPacket to use takeBuffer(pktLen) instead of takeSmallBuffer(pktLen) . |
In the code where rabbits hop,
Contributions never stop!
Jakub's name now shines so bright,
Buffers change to take new flight.
Celebrate with joy and cheer,
For every change brings us near! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
Targets issue in #1482. When username/password (JWT token usually) are too long, there are unable to fit into buffer, which has only 4k at connection startup. Using takeBuffer (which autogrows) instead of takeSmallBuffer should work in this case.
I did not find any "better" solution to this problem as checking length of packet before choosing buffer would be practicaly the same logic and conditions, what takeBuffer does. If there is need to use takeSmallBuffer for perfomrance reasons, there can be takeSmallBuffer kept and takeBuffer called only after failure, which seems to be ugliest solution.
Checklist
Summary by CodeRabbit
Documentation
AUTHORS
file to acknowledge contributions.Improvements