def handle(self, sock, addr):
        """Intercepts calls to :meth:`~slimta.edge.EdgeServer.handle`, reads
        the proxy protocol header, and then resumes the original call.

        """
        try:
            initial = self.__read_pp_initial(sock)
            if initial.startswith(b'PROXY '):
                src_addr, _ = ProxyProtocolV1.process_pp_v1(sock, initial)
            elif initial == b'\r\n\r\n\x00\r\nQ':
                src_addr, _ = ProxyProtocolV2.process_pp_v2(sock, initial)
            else:
                raise AssertionError('Invalid proxy protocol signature')
        except LocalConnection:
            log.proxyproto_local(sock)
            return
        except __HOLE__ as exc:
            log.proxyproto_invalid(sock, exc)
            src_addr = invalid_pp_source_address
        else:
            log.proxyproto_success(sock, src_addr)
        return super(ProxyProtocol, self).handle(sock, src_addr)


# vim:et:fdm=marker:sts=4:sw=4:ts=4
dataset/ETHPy150Open slimta/python-slimta/slimta/util/proxyproto.py/ProxyProtocol.handle