Misnamed BNetBuffer / DynamicBuffer methods
|Reported by:||Shisui||Owned by:||nobody|
|Component:||Network & Internet||Version:||R1/alpha2|
- 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)