'Pass readline request to the underlying file-like object and
add bytes read to total.'

def readline(self, *args, **kwargs):

    try:
        line = self.wsgi_input.readline(*args, **kwargs)
    except Exception:
        self.client_disconnect = True
        raise
    self.bytes_received += len(line)
    return line
