'Read self.rfile into self.inheaders. Return success.'

def read_request_headers(self):

    try:
        read_headers(self.rfile, self.inheaders)
    except ValueError:
        ex = sys.exc_info()[1]
        self.simple_response('400    Bad    Request', ex.args[0])
        return False
    mrbs = self.server.max_request_body_size
    if (mrbs and (int(self.inheaders.get('Content-Length', 0)) > mrbs)):
        self.simple_response('413    Request    Entity    Too    Large', 'The    entity    sent    with    the    request    exceeds    the    maximum    allowed    bytes.')
        return False
    if (self.response_protocol == 'HTTP/1.1'):
        if (self.inheaders.get('Connection', '') == 'close'):
            self.close_connection = True
    elif (self.inheaders.get('Connection', '') != 'Keep-Alive'):
        self.close_connection = True
    te = None
    if (self.response_protocol == 'HTTP/1.1'):
        te = self.inheaders.get('Transfer-Encoding')
        if te:
            te = [x.strip().lower() for x in te.split(',') if x.strip()]
    self.chunked_read = False
    if te:
        for enc in te:
            if (enc == 'chunked'):
                self.chunked_read = True
            else:
                self.simple_response('501    Unimplemented')
                self.close_connection = True
                return False
    if (self.inheaders.get('Expect', '') == '100-continue'):
        msg = (self.server.protocol.encode('ascii') + '    100    Continue\r\n\r\n')
        try:
            self.conn.wfile.write(msg)
        except socket.error:
            x = sys.exc_info()[1]
            if (x.args[0] not in socket_errors_to_ignore):
                raise
    return True
