mirror of
https://github.com/telemt/telemt.git
synced 2026-11-01 21:31:58 +03:00
Bridge Request/Buffers/Recovery
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@ use super::{
|
||||
};
|
||||
use crate::web::frame::{self, FrameType};
|
||||
use crate::web::manager::ManagerError;
|
||||
use crate::web::telemetry::WebSessionLifecycleObservation;
|
||||
|
||||
impl WebSession {
|
||||
/// Polls pending downlink frames with cursor replay and newest-poll-wins semantics.
|
||||
@@ -22,14 +23,19 @@ impl WebSession {
|
||||
if state.closed {
|
||||
return Err(ManagerError::Closed);
|
||||
}
|
||||
state.activity.touch_peer(Instant::now());
|
||||
if let Some(unacked) = &state.unacked {
|
||||
if cursor == unacked.base_cursor {
|
||||
return Ok(PollResult {
|
||||
let result = PollResult {
|
||||
body: unacked.body.clone(),
|
||||
next_cursor: unacked.next_cursor,
|
||||
lane_closed: false,
|
||||
});
|
||||
};
|
||||
self.touch_peer_locked(
|
||||
&mut state,
|
||||
Instant::now(),
|
||||
WebSessionLifecycleObservation::HttpActivityAfterGap,
|
||||
);
|
||||
return Ok(result);
|
||||
}
|
||||
if cursor != unacked.next_cursor {
|
||||
drop(state);
|
||||
@@ -53,6 +59,11 @@ impl WebSession {
|
||||
return Err(ManagerError::Protocol);
|
||||
};
|
||||
state.down_epoch = epoch;
|
||||
self.touch_peer_locked(
|
||||
&mut state,
|
||||
Instant::now(),
|
||||
WebSessionLifecycleObservation::HttpActivityAfterGap,
|
||||
);
|
||||
let healthy = self.carrier_health_ready_locked(&mut state, Instant::now());
|
||||
(state.down_epoch, healthy)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user