(self)
waiting for a version reply
waiting for a version reply
waiting for a version reply
def _parse_version_reply(self):
        "waiting for a version reply"
        if len(self._data) >= 2:
            reply = self._data[:2]
            self._data = self._data[2:]
            (version, method) = struct.unpack('BB', reply)
            if version == 5 and method in [0x00, 0x02]:
                self.version_reply(method)
            else:
                if version != 5:
                    self.version_error(SocksError(
                        "Expected version 5, got {}".format(version)))
                else:
                    self.version_error(SocksError(
                        "Wanted method 0 or 2, got {}".format(method)))
def _parse_version_reply ( self ) : if len ( self . _data ) >= 2 : reply = self . _data [ : 2 ] self . _data = self . _data [ 2 : ] ( version , method ) = struct . unpack ( 'BB' , reply ) if version == 5 and method in [ 0x00 , 0x02 ] : self . version_reply ( method ) else : if version != 5 : self . version_error ( SocksError ( "Expected version 5, got {}" . format ( version ) ) ) else : self . version_error ( SocksError ( "Wanted method 0 or 2, got {}" . format ( method ) ) )