Skip to content

[IN PROGRESS] data pipe#3

Open
ruiting-chen wants to merge 6 commits into
feat/bidirectional-pipefrom
feat/data-pipe
Open

[IN PROGRESS] data pipe#3
ruiting-chen wants to merge 6 commits into
feat/bidirectional-pipefrom
feat/data-pipe

Conversation

@ruiting-chen
Copy link
Copy Markdown

Branches off feat/bidirectional-pipe

  • protocol: DataFrameHeader + FrameType (Data, Fin, Rst)
  • SyncStream (spin) and AsyncStream (yield) with send, recv, shutdown, send_rst, ready_to_free
  • pipe additions:
    • RingProducer::bytes_pending()
    • BidirectionalPipe::outgoing_bytes_remaining() -> used by ready_to_free()

Comment thread data-pipe/src/sync_stream.rs Outdated
Err(StreamError::ConnectionReset)
}
Some(FrameType::Data) => {
read_exact(&mut self.pipe, &mut buf[..payload_len as usize]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

payload_len could overflow if header is malformed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated: recv now reads min(payload_len, buf.len()) bytes, the number of remaining bytes in the payload is tracked in current_frame_remaining and read on subsequent calls to recv

Comment thread data-pipe/src/async_stream.rs Outdated
}
Some(FrameType::Data) => {
let len = payload_len as usize;
read_exact(&mut self.pipe, &mut buf[..len]).await;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same issue here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same update here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants