aptdetector/network/parser/httpparser.py
def read_response(self, reader, message):
        """read and output one http response

        Args:
            reader (DataReader): type of reader that is required
            message (RequestMessage): response packet
        Returns:
            None
        """
        resp_header = self.read_http_resp_header(reader)
        if resp_header is None:
            reader.skip_all()
            return

        if message.expect_header:
            if resp_header.status_code == 100:
                # expected 100, we do not read body
                reader.skip_all()
                return

        # read body
        # if not resp_header.chunked:
        #     if resp_header.content_len == 0:
        #         if resp_header.connection_close:
        #             # we can't get content length, so assume it till the end of data.
        #             resp_header.content_len = 10000000
        #         else:
        #             # we can't get content length, and is not a chunked body, we cannot do nothing,
        #             # just read all data.
        #             resp_header.content_len = 10000000
        #     content = reader.read(resp_header.content_len)
        # else:
        #     content = self.read_chunked_body(reader)
        #
        # if not message.filtered:
        #     self.processor.on_http_resp(resp_header, content)
read and output one http response

        Args:
            reader (DataReader): type of reader that is required
            message (RequestMessage): response packet
        Returns:
            None
        
read and output one http response
read and output one http response
def read_response(self, reader, message):
        resp_header = self.read_http_resp_header(reader)
        if resp_header is None:
            reader.skip_all()
            return
        if message.expect_header:
            if resp_header.status_code == 100:
                reader.skip_all()
                return
         if not message.filtered:
             self.processor.on_http_resp(resp_header, content)
def read_response ( self , reader , message ) : resp_header = self . read_http_resp_header ( reader ) if resp_header is None : reader . skip_all ( ) return if message . expect_header : if resp_header . status_code == 100 : reader . skip_all ( ) return
read and output one http response
read and output one http response
"""read and output one http response

        Args:
            reader (DataReader): type of reader that is required
            message (RequestMessage): response packet
        Returns:
            None
        """ # expected 100, we do not read body # read body # if not resp_header.chunked: #     if resp_header.content_len == 0: #         if resp_header.connection_close: #             # we can't get content length, so assume it till the end of data. #             resp_header.content_len = 10000000 #         else: #             # we can't get content length, and is not a chunked body, we cannot do nothing, #             # just read all data. #             resp_header.content_len = 10000000 #     content = reader.read(resp_header.content_len) # else: #     content = self.read_chunked_body(reader) # # if not message.filtered: #     self.processor.on_http_resp(resp_header, content)
None
self
reader
type of reader that is required
type of reader that is required
message
None