'Handle client data during the handshake.'

def _handshake_select_fn(self):

    try:
        data = self.socket.recv(8192)
    except socket.error:
        self.logger.info('Blame:    Erorr    reading    from    client    %s.', self.address)
        return False
    if (not data):
        self.logger.info('Blame:    Client    %s    closed    connection.', self.address)
        return False
    data = (self._buffer + data)
    lines = data.split('\n')
    if (lines[(-1)].strip() != ''):
        self._buffer = data
        return
    data = data.replace('\r', '')
    lines = data[:data.index('\n\n')].split('\n')
    try:
        self._parse_headers(lines)
        self._send_headers()
    except (ValueError, KeyError, IndexError, socket.error) as e:
        try:
            self.socket.sendall('400    Error    parsing    message\n\n')
        except socket.error:
            pass
        self.logger.info(('Blame:    Bad    handshake    from    %s:    %s' % (self.address, e)))
        return False
    self.logger.info('Blame:    New    client    from    %s', self.address)
    self._select_fn = self._response_select_fn
    self._handshake_completed = True
    return True
