mirror of https://github.com/n1nj4sec/pupy.git
Add method to get buffer map (debug)
This commit is contained in:
parent
9b9633e255
commit
04ff12db62
|
@ -447,6 +447,16 @@ class Buffer(object):
|
|||
|
||||
del self._data[:todel]
|
||||
|
||||
def chunksinfo(self):
|
||||
result = ''
|
||||
if self._bofft:
|
||||
result = "+{}:".format(self._bofft)
|
||||
|
||||
result += ','.join(
|
||||
'{}:{}'.format(len(x), type(x).__name__) for x in self._data)
|
||||
|
||||
return '<Buffer: {}>'.format(result)
|
||||
|
||||
def __len__(self):
|
||||
"""Returns length of buffer. Used in len()."""
|
||||
return self._len
|
||||
|
|
Loading…
Reference in New Issue