stanzastream: actually count stanzas in stream management
Looks like a horrible oversight. And this will need tests, but I'm short on time right now. Fixes #170.
This commit is contained in:
parent
3bda04124e
commit
a1ade974b0
4 changed files with 13 additions and 0 deletions
|
|
@ -543,6 +543,9 @@ impl ConnectedState {
|
|||
match item {
|
||||
// Easy case, we got some data.
|
||||
Ok(XmppStreamElement::Stanza(data)) => {
|
||||
if let Some(sm_state) = sm_state.as_mut() {
|
||||
sm_state.received();
|
||||
}
|
||||
Poll::Ready(Some(ConnectedEvent::Worker(WorkerEvent::Stanza(data))))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -214,6 +214,11 @@ impl SmState {
|
|||
self.inbound_ctr
|
||||
}
|
||||
|
||||
/// Increase the inbound counter.
|
||||
pub fn received(&mut self) {
|
||||
self.inbound_ctr = self.inbound_ctr.wrapping_add(1);
|
||||
}
|
||||
|
||||
/// Get the info necessary for resumption.
|
||||
///
|
||||
/// Returns the stream ID and the current inbound counter if resumption is
|
||||
|
|
|
|||
Loading…
Reference in a new issue