def sm_ack(self, remote_ctr):
        """
        Process the remote stanza counter `remote_ctr`. Any acked stanzas are
        dropped from :attr:`sm_unacked_list` and put into
        :attr:`StanzaState.ACKED` state and the counters are increased
        accordingly.

        If called with an erroneous remote stanza counter
        :class:`.errors.StreamNegotationFailure` will be raised.

        Attempting to call this without Stream Management enabled results in a
        :class:`RuntimeError`.
        """

        if not self._sm_enabled:
            raise RuntimeError("Stream Management is not enabled")

        self._logger.debug("sm_ack(%d)", remote_ctr)
        to_drop = (remote_ctr - self._sm_outbound_base) & 0xffffffff
        self._logger.debug("sm_ack: to drop %d, unacked: %d",
                           to_drop, len(self._sm_unacked_list))
        if to_drop > len(self._sm_unacked_list):
            raise errors.StreamNegotiationFailure(
                "acked more stanzas than have been sent "
                "(outbound_base={}, remote_ctr={})".format(
                    self._sm_outbound_base,
                    remote_ctr
                )
            )

        acked = self._sm_unacked_list[:to_drop]
        del self._sm_unacked_list[:to_drop]
        self._sm_outbound_base = remote_ctr

        if acked:
            self._logger.debug("%d stanzas acked by remote", len(acked))
        for token in acked:
            token._set_state(StanzaState.ACKED)
def sm_ack ( self , remote_ctr ) : if not self . _sm_enabled : raise RuntimeError ( "Stream Management is not enabled" ) self . _logger . debug ( "sm_ack(%d)" , remote_ctr ) to_drop = ( remote_ctr - self . _sm_outbound_base ) & 0xffffffff self . _logger . debug ( "sm_ack: to drop %d, unacked: %d" , to_drop , len ( self . _sm_unacked_list ) ) if to_drop > len ( self . _sm_unacked_list ) : raise errors . StreamNegotiationFailure ( "acked more stanzas than have been sent " "(outbound_base={}, remote_ctr={})" . format ( self . _sm_outbound_base , remote_ctr ) ) acked = self . _sm_unacked_list [ : to_drop ] del self . _sm_unacked_list [ : to_drop ] self . _sm_outbound_base = remote_ctr if acked : self . _logger . debug ( "%d stanzas acked by remote" , len ( acked ) ) for token in acked : token . _set_state ( StanzaState . ACKED )
Process the remote stanza counter `remote_ctr`. Any acked stanzas are
        dropped from :attr:`sm_unacked_list` and put into
        :attr:`StanzaState.ACKED` state and the counters are increased
        accordingly.

        If called with an erroneous remote stanza counter
        :class:`.errors.StreamNegotationFailure` will be raised.

        Attempting to call this without Stream Management enabled results in a
        :class:`RuntimeError`.