Skip to content

Commit 533bdd6

Browse files
committed
fix: Fix QNS test errors with nginx
And hopefully `haproxy`. The old code caused ACK-ECN frames to be sent that had all-zero counts, which I don't think is a violation of the RFC, but we still shouldn't do. Fixes mozilla#2566.
1 parent 00646f0 commit 533bdd6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

neqo-transport/src/ecn.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,16 @@ impl Count {
103103
Self(EnumMap::from_array([not_ect, ect1, ect0, ce]))
104104
}
105105

106-
/// Whether any of the ECN counts are non-zero.
106+
/// Whether any of the ECT(0), ECT(1) or CE counts are non-zero.
107107
#[must_use]
108108
pub fn is_some(&self) -> bool {
109-
self.0.iter().any(|(_, &count)| count > 0)
109+
self[IpTosEcn::Ect0] > 0 || self[IpTosEcn::Ect1] > 0 || self[IpTosEcn::Ce] > 0
110110
}
111111

112-
/// Whether all of the ECN counts are zero.
112+
/// Whether all of the ECN counts are zero (including Not-ECT.)
113113
#[must_use]
114114
pub fn is_empty(&self) -> bool {
115-
!self.is_some()
115+
self.iter().all(|(_, count)| *count == 0)
116116
}
117117
}
118118

0 commit comments

Comments
 (0)