Skip to content

Commit

Permalink
Fix build with no alloc or collections.
Browse files Browse the repository at this point in the history
whitequark committed Jan 22, 2017
1 parent 6a2c009 commit 309d0f5
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/socket/set.rs
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@ impl<'a, 'b: 'a, 'c: 'a + 'b> Set<'a, 'b, 'c> {
ManagedSlice::Borrowed(_) => {
panic!("adding a socket to a full SocketSet")
}
#[cfg(any(feature = "use_std", feature = "use_collections"))]
ManagedSlice::Owned(ref mut sockets) => {
sockets.push(None);
let index = sockets.len() - 1;
2 changes: 2 additions & 0 deletions src/socket/tcp.rs
Original file line number Diff line number Diff line change
@@ -477,6 +477,7 @@ impl<'a> TcpSocket<'a> {
pub fn send(&mut self, size: usize) -> Result<&mut [u8], ()> {
if !self.may_send() { return Err(()) }

#[cfg(any(test, feature = "verbose"))]
let old_length = self.tx_buffer.len();
let buffer = self.tx_buffer.enqueue(size);
if buffer.len() > 0 {
@@ -512,6 +513,7 @@ impl<'a> TcpSocket<'a> {
// but until the connection is fully open we refuse to dequeue any data.
if !self.may_recv() { return Err(()) }

#[cfg(any(test, feature = "verbose"))]
let old_length = self.rx_buffer.len();
let buffer = self.rx_buffer.dequeue(size);
self.remote_seq_no += buffer.len();

0 comments on commit 309d0f5

Please sign in to comment.