mirror of https://github.com/ospab/ostp.git
fix: resolve deadlock, multiplexing backpressure, and LTE fragmentation issues
This commit is contained in:
parent
8771f17371
commit
c9fad99144
|
|
@ -617,8 +617,8 @@ impl Bridge {
|
|||
}
|
||||
}
|
||||
proxy_ev = proxy_rx.recv(), if self.running && sessions_opt.as_ref().map(|s| {
|
||||
// Backpressure: suspend proxy reads when ARQ window is saturated
|
||||
s.iter().all(|ses| ses.machine.in_flight_count() < ses.machine.cwnd_packets().clamp(16, 16384))
|
||||
// Backpressure: suspend proxy reads when ARQ window is saturated across ALL sessions
|
||||
s.iter().any(|ses| ses.machine.in_flight_count() < ses.machine.cwnd_packets().clamp(16, 16384))
|
||||
}).unwrap_or(true) => {
|
||||
if let Some(ev) = proxy_ev {
|
||||
if let Some(sessions) = sessions_opt.as_mut() {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ pub struct OstpConfig {
|
|||
|
||||
fn default_keepalive() -> u64 { 5 }
|
||||
|
||||
fn default_mtu() -> usize { 1500 }
|
||||
fn default_mtu() -> usize { 1140 }
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct LocalProxyConfig {
|
||||
|
|
|
|||
|
|
@ -557,9 +557,6 @@ impl ProtocolMachine {
|
|||
// Limit retransmits per tick to prevent bandwidth saturation
|
||||
let mut retransmit_budget: usize = self.cc.retransmit_budget();
|
||||
for frame in self.sent_history.iter_mut() {
|
||||
if retransmit_budget == 0 {
|
||||
break;
|
||||
}
|
||||
if !frame.is_retransmittable {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -571,8 +568,11 @@ impl ProtocolMachine {
|
|||
if now.duration_since(frame.last_sent) >= effective_rto {
|
||||
frame.last_sent = now;
|
||||
frame.retries = frame.retries.saturating_add(1);
|
||||
actions.push(ProtocolAction::SendDatagram(frame.bytes.clone()));
|
||||
retransmit_budget -= 1;
|
||||
|
||||
if retransmit_budget > 0 {
|
||||
actions.push(ProtocolAction::SendDatagram(frame.bytes.clone()));
|
||||
retransmit_budget -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class OstpVpnService : VpnService() {
|
|||
.addRoute("0.0.0.0", 0)
|
||||
.addRoute("::", 0)
|
||||
.addDnsServer(dnsServer)
|
||||
.setMtu(json.optJSONObject("ostp")?.optInt("mtu", 1280) ?: 1280)
|
||||
.setMtu(json.optJSONObject("ostp")?.optInt("mtu", 1140) ?: 1140)
|
||||
|
||||
try { builder.addDnsServer("8.8.8.8") } catch (e: Throwable) {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue