Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory issues with DatagramIterator and bindings #1

Open
kestred opened this issue Sep 15, 2014 · 0 comments
Open

Memory issues with DatagramIterator and bindings #1

kestred opened this issue Sep 15, 2014 · 0 comments
Labels

Comments

@kestred
Copy link
Member

kestred commented Sep 15, 2014

When constructing a DatagramIterator from a Datagram, the DatagramIterator incorrectly reports its own remaining size.

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

# Correct behavior!!!
>>> from bamboo.wire import *
>>> dg = Datagram()
>>> dgi = DatagramIterator(dg)
>>> dgi.remaining()
0L

# Weird memory issues
>>> dg = DatagramIterator(Datagram())
>>> dg.remaining()
100L
>>> dg.read_bool()
True
>>> dg.remaining()
99L
>>> dg.read_bool()
False
>>> dg.remaining()
22473L
>>> dg.tell()
2L
>>> dgi = DatagramIterator(Datagram())
>>> dgi.remaining()
22475L
>>> dgi.remaining()
100L
>>> dgi.remaining()
446L
>>> dgi.remaining()
100L
>>> dgi.remaining()
22475L
>>> dgi.remaining()
100L
>>> 
@kestred kestred added the bug label Sep 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant