Misnamed BNetBuffer / DynamicBuffer methods
- BNetBuffer::Size() should (according to the BeBook), return the number of bytes currently in the buffer.. Actually, if we look at the source code (in src/kits/network/libnetapi/DynamicBuffer.cpp :: Size() ) it returns the allocated buffer size (i.e including unused bytes at the end and wasted bytes at the beginning of the buffer).
- BNetBuffer::BytesRemaining() should return the number of unused bytes in the buffer. while it returns the number of used bytes in the buffer (this is what Size() should do).
It seems that the members bodies doesn't correspond to the right member names (e.g: DynamicBuffer::Size() should return fDataEnd - fDataStart and DynamicBuffer::BytesRemaining() should return fBufferSize - fDataEnd, since "remaining" bytes are located in the end of the buffer)
Change History
(3)
Resolution: |
→ fixed
|
Status: |
new → closed
|
Blocked By: |
4724 removed
|
Blocking: |
4724 added
|
Fixed in hrev37437. Thanks.