'Call processEnded on protocol after final cleanup.'

def maybeCallProcessEnded(self):

    if (self.proto is not None):
        reason = self._getReason(self.status)
        proto = self.proto
        self.proto = None
        try:
            proto.processEnded(Failure(reason))
        except:
            err(None, 'unexpected    error    in    processEnded')
