XyloSiteMonitor

Check-in [15b687b191]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add support for HTTP2
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 15b687b1911fae65faaf9e83cea200c43769d16cb6aeea8288f787654e1bee61
User & Date: xylon 2019-05-11 07:30:53
Context
2019-05-11
07:31
remove support for HTTP0 check-in: 05fff0486d user: xylon tags: trunk
07:30
Add support for HTTP2 check-in: 15b687b191 user: xylon tags: trunk
2018-11-04
15:48
Improve comments check-in: af09294ed6 user: xylon tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to xylositemonitor.py.

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
def header_function(header_line):
    """We have to parse http headers manually becasue libcurl doesn't do it for us."""

    # HTTP standard specifies that headers are encoded in iso-8859-1.
    header_line = header_line.decode('iso-8859-1')

    # Header lines include the first status line (HTTP/1.x ...).
    if header_line[:6] == "HTTP/1":
        # get status code
        status = re.search(r'[0123456789]{3}', header_line).group(0)
        headers['status'] = status
        return

    # We are going to ignore all lines that don't have a colon in them.
    # This will botch headers that are split on multiple lines...







|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
def header_function(header_line):
    """We have to parse http headers manually becasue libcurl doesn't do it for us."""

    # HTTP standard specifies that headers are encoded in iso-8859-1.
    header_line = header_line.decode('iso-8859-1')

    # Header lines include the first status line (HTTP/1.x ...).
    if re.search(r'\AHTTP/[0123456789]', header_line[:6]):
        # get status code
        status = re.search(r'[0123456789]{3}', header_line).group(0)
        headers['status'] = status
        return

    # We are going to ignore all lines that don't have a colon in them.
    # This will botch headers that are split on multiple lines...