mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-14 06:50:01 -04:00
wisp_mux v1.1.1: fix continue packets and flow control
This commit is contained in:
parent
9ebb24b088
commit
8b2a8a3eb3
4 changed files with 43 additions and 27 deletions
|
@ -53,7 +53,7 @@ impl<W: crate::ws::WebSocketWrite + Send + 'static> MuxStreamRead<W> {
|
|||
match self.rx.next().await? {
|
||||
MuxEvent::Send(bytes) => {
|
||||
if self.role == crate::Role::Server && self.stream_type == crate::StreamType::Tcp {
|
||||
let old_val = self.flow_control.fetch_add(1, Ordering::SeqCst);
|
||||
let old_val = self.flow_control.fetch_add(1, Ordering::AcqRel);
|
||||
self.tx
|
||||
.write_frame(
|
||||
crate::Packet::new_continue(self.stream_id, old_val + 1).into(),
|
||||
|
@ -115,8 +115,7 @@ impl<W: crate::ws::WebSocketWrite + Send + 'static> MuxStreamWrite<W> {
|
|||
self.flow_control.store(
|
||||
self.flow_control
|
||||
.load(Ordering::Acquire)
|
||||
.checked_add(1)
|
||||
.unwrap_or(0),
|
||||
.saturating_sub(1),
|
||||
Ordering::Release,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue