code refactoring + gitignore updtae

This commit is contained in:
citronneur
2014-11-20 22:14:16 +01:00
parent 7fc25e35f1
commit 4e7ea06906
2 changed files with 6 additions and 6 deletions

5
.gitignore vendored
View File

@@ -2,7 +2,8 @@
.project
.pydevproject
README.md~
rdpy/core/tmp/*
*.so
*.os
.sconsign.dblite
dist/*
build/*
rdpy.egg-info/*

View File

@@ -76,8 +76,6 @@ class TPKT(RawLayer, IFastPathSender):
@param fastPathListener: IFastPathListener
"""
RawLayer.__init__(self, presentation)
#last packet version read from header
self._lastPacketVersion = UInt8()
#length may be coded on more than 1 bytes
self._lastShortLength = UInt8()
#fast path listener
@@ -104,9 +102,10 @@ class TPKT(RawLayer, IFastPathSender):
@param data: Stream received from twisted layer
"""
#first read packet version
data.readType(self._lastPacketVersion)
version = UInt8()
data.readType(version)
#classic packet
if self._lastPacketVersion.value == Action.FASTPATH_ACTION_X224:
if version.value == Action.FASTPATH_ACTION_X224:
#padding
data.readType(UInt8())
#read end header