whitequark пре 7 година
родитељ
комит
c879b39629
1 измењених фајлова са 4 додато и 5 уклоњено
  1. 4 5
      src/socket/tcp.rs

+ 4 - 5
src/socket/tcp.rs

@@ -627,15 +627,14 @@ impl<'a> TcpSocket<'a> {
         // another (stale) SYN.
         if !self.may_recv() { return Err(Error::Illegal) }
 
-        #[cfg(any(test, feature = "verbose"))]
-        let old_length = self.rx_buffer.len();
+        let _old_length = self.rx_buffer.len();
         let buffer = self.rx_buffer.dequeue_many(size);
         self.remote_seq_no += buffer.len();
         if buffer.len() > 0 {
             #[cfg(any(test, feature = "verbose"))]
             net_trace!("[{}]{}:{}: rx buffer: dequeueing {} octets (now {})",
                        self.debug_id, self.local_endpoint, self.remote_endpoint,
-                       buffer.len(), old_length - buffer.len());
+                       buffer.len(), _old_length - buffer.len());
         }
         Ok(buffer)
     }
@@ -650,14 +649,14 @@ impl<'a> TcpSocket<'a> {
         // See recv() above.
         if !self.may_recv() { return Err(Error::Illegal) }
 
-        let old_length = self.rx_buffer.len();
+        let _old_length = self.rx_buffer.len();
         let dequeued = self.rx_buffer.dequeue_slice(data);
         self.remote_seq_no += dequeued;
         if dequeued > 0 {
             #[cfg(any(test, feature = "verbose"))]
             net_trace!("[{}]{}:{}: rx buffer: dequeueing {} octets (now {})",
                        self.debug_id, self.local_endpoint, self.remote_endpoint,
-                       dequeued, old_length - dequeued);
+                       dequeued, _old_length - dequeued);
         }
         Ok(dequeued)
     }