aptdetector/network/parser/httpparser.py
def send(self, http_type, data):
        """append http request or reponses

        if the connection is not initiated yet then start the connection
        and if it's still the current connection then append the packet

        Args:
            http_type (HttpType): type of packet
            data (str):  data of unparsed packet
        Returns:
            None
        """
        pkt = None
        if not self.inited:
            self._init(http_type, data)
            self.inited = True

        if not self.is_http:
            return None

        # still current http request/response
        if self.cur_type == http_type:
            self.cur_data.append(data)
            return None

        if self.cur_data is not None:
            reader = DataReader(self.cur_data)
            if self.cur_type == HttpType.REQUEST:
                pkt = self.read_request(reader, self.message)
            elif self.cur_type == HttpType.RESPONSE:
                self.read_response(reader, self.message)

        self.cur_type = http_type

        # new http request/response
        self.cur_data = []
        self.cur_data.append(data)
        if pkt is not None:
            return pkt
        else:
            return None
append http request or reponses

        if the connection is not initiated yet then start the connection
        and if it's still the current connection then append the packet

        Args:
            http_type (HttpType): type of packet
            data (str):  data of unparsed packet
        Returns:
            None
        
append http request or reponses
if the connection is not initiated yet then start the connection
and if it's still the current connection then append the packet
append http request or reponses if the connection is not initiated yet then start the connection and if it ' s still the current connection then append the packet
def send(self, http_type, data):
        pkt = None
        if not self.inited:
            self._init(http_type, data)
            self.inited = True
        if not self.is_http:
            return None
        if self.cur_type == http_type:
            self.cur_data.append(data)
            return None
        if self.cur_data is not None:
            reader = DataReader(self.cur_data)
            if self.cur_type == HttpType.REQUEST:
                pkt = self.read_request(reader, self.message)
            elif self.cur_type == HttpType.RESPONSE:
                self.read_response(reader, self.message)
        self.cur_type = http_type
        self.cur_data = []
        self.cur_data.append(data)
        if pkt is not None:
            return pkt
        else:
            return None
def send ( self , http_type , data ) : pkt = None if not self . inited : self . _init ( http_type , data ) self . inited = True if not self . is_http : return None if self . cur_type == http_type : self . cur_data . append ( data ) return None if self . cur_data is not None : reader = DataReader ( self . cur_data ) if self . cur_type == HttpType . REQUEST : pkt = self . read_request ( reader , self . message ) elif self . cur_type == HttpType . RESPONSE : self . read_response ( reader , self . message ) self . cur_type = http_type self . cur_data = [ ] self . cur_data . append ( data ) if pkt is not None : return pkt else : return None
append http request or reponses
if the connection is not initiated yet then start the connection
and if it's still the current connection then append the packet
append http request or reponses if the connection is not initiated yet then start the connection and if it ' s still the current connection then append the packet
"""append http request or reponses

        if the connection is not initiated yet then start the connection
        and if it's still the current connection then append the packet

        Args:
            http_type (HttpType): type of packet
            data (str):  data of unparsed packet
        Returns:
            None
        """ # still current http request/response # new http request/response
None
self
http_type
type of packet
type of packet
data
data of unparsed packet
data of unparsed packet