'Consume a chunk of data and attempt to parse it.
@param data: A bytestring.
@type data: bytes
@return: A two-tuple containing, in order, a L{_interfaces.IProxyInfo}
and any bytes fed to the parser that followed the end of the
header.  Both of these values are None until a complete header is
parsed.
@raises InvalidProxyHeader: If the bytes fed to the parser create an
invalid PROXY header.'

def feed(self, data):

    self.buffer += data
    if (len(self.buffer) < 16):
        raise InvalidProxyHeader()
    size = (struct.unpack('!H', self.buffer[14:16])[0] + 16)
    if (len(self.buffer) < size):
        return (None, None)
    (header, remaining) = (self.buffer[:size], self.buffer[size:])
    self.buffer = ''
    info = self.parse(header)
    return (info, remaining)
