Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#6282 closed bug (fixed)

Misnamed BNetBuffer / DynamicBuffer methods

Reported by: Shisui Owned by: nobody
Priority: normal Milestone: R1
Component: Network & Internet Version: R1/alpha2
Keywords: bnetbuffer network_kit Cc:
Blocked By: Blocking: #4724
Platform: All

Description

  • 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)

comment:1 by phoudoin, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev37437. Thanks.

comment:2 by phoudoin, 14 years ago

Blocked By: 4724 added

comment:3 by phoudoin, 14 years ago

Blocked By: 4724 removed
Blocking: 4724 added
Note: See TracTickets for help on using tickets.