From 7454868a1e156f78eafbca7e7d8a5b99e4447bc4 Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Thu, 17 Aug 2023 22:28:31 -0400 Subject: [PATCH] renamed functions --- src/seq_queue.rs | 6 +++--- src/single_thread.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/seq_queue.rs b/src/seq_queue.rs index 4d5f58f..689f994 100644 --- a/src/seq_queue.rs +++ b/src/seq_queue.rs @@ -255,7 +255,7 @@ impl SeqEx { } /// If this returns `Ok` then `try_send` might succeed on next call. - pub fn receive_direct>( + pub fn receive_raw_and_direct>( &mut self, seq_no: SeqNo, reply_no: Option, @@ -364,7 +364,7 @@ impl SeqEx { /// and since each fragment will be received in order it will be trivial for them to reconstruct /// the original file. #[must_use] - pub fn reply_direct(&mut self, reply_no: SeqNo, packet_data: SendData, current_time: i64) -> Option> { + pub fn reply_raw_and_direct(&mut self, reply_no: SeqNo, packet_data: SendData, current_time: i64) -> Option> { if self.remove_reservation(reply_no) { let seq_no = self.next_send_seq_no; self.next_send_seq_no = self.next_send_seq_no.wrapping_add(1); @@ -391,7 +391,7 @@ impl SeqEx { None } } - pub fn ack_direct(&mut self, reply_no: SeqNo) -> Option> { + pub fn ack_raw_and_direct(&mut self, reply_no: SeqNo) -> Option> { if self.remove_reservation(reply_no) { Some(Packet::Ack { reply_no }) } else { diff --git a/src/single_thread.rs b/src/single_thread.rs index 0681679..15ba365 100644 --- a/src/single_thread.rs +++ b/src/single_thread.rs @@ -21,7 +21,7 @@ impl<'a, TL: TransportLayer, SendData, RecvData, const CAP: usize> Rep impl<'a, TL: TransportLayer, SendData, RecvData, const CAP: usize> Drop for ReplyGuard<'a, TL, SendData, RecvData, CAP> { fn drop(&mut self) { if let Some(app) = &mut self.1 { - if let Some(p) = self.0.ack_direct(self.2) { + if let Some(p) = self.0.ack_raw_and_direct(self.2) { app.send(p) } } @@ -52,7 +52,7 @@ impl SeqEx { reply_no: Option, packet: P, ) -> Result<(SeqNo, P, Option), Error> { - match self.receive_direct(seq_no, reply_no, packet) { + match self.receive_raw_and_direct(seq_no, reply_no, packet) { Ok(a) => Ok(a), Err(DirectError::ResendAck(reply_no)) => { app.send(Packet::Ack { reply_no }); @@ -63,12 +63,12 @@ impl SeqEx { } } pub fn reply_raw(&mut self, mut app: impl TransportLayer, reply_no: SeqNo, packet_data: SendData) { - if let Some(p) = self.reply_direct(reply_no, packet_data, app.time()) { + if let Some(p) = self.reply_raw_and_direct(reply_no, packet_data, app.time()) { app.send(p) } } pub fn ack_raw(&mut self, mut app: impl TransportLayer, reply_no: SeqNo) { - if let Some(p) = self.ack_direct(reply_no) { + if let Some(p) = self.ack_raw_and_direct(reply_no) { app.send(p) } }