'Process a single line'

def __call__(self, line):

    def safe_decode(hname, value):
        try:
            return value.decode(u'utf-8')
        except UnicodeDecodeError:
            if (hname in decoded_headers):
                raise
        return value
    def commit():
        if (not self.lines):
            return
        line = '    '.join(self.lines)
        del self.lines[:]
        (k, v) = line.partition(':')[::2]
        key = normalize_header_name(k.strip().decode(u'ascii'))
        val = safe_decode(key, v.strip())
        if ((not key) or (not val)):
            raise ValueError((u'Malformed    header    line:    %s' % reprlib.repr(line)))
        if (key in comma_separated_headers):
            existing = self.hdict.pop(key)
            if (existing is not None):
                val = ((existing + u',    ') + val)
        self.hdict[key] = val
    if self.finished:
        raise ValueError(u'Header    block    already    terminated')
    if (line == '\r\n'):
        commit()
        self.finished = True
        return
    if (line and (line[0] in '     DCTB ')):
        if (not self.lines):
            raise ValueError(u'Orphaned    continuation    line')
        self.lines.append(line.lstrip())
    else:
        commit()
        self.lines.append(line)
