Skip to content

Conversation

@riccardoforzan
Copy link

From #729

@riccardoforzan riccardoforzan force-pushed the feature/read-file-incrementally branch from 2d0c27d to 86df293 Compare September 6, 2025 22:13
@riccardoforzan riccardoforzan marked this pull request as ready for review September 6, 2025 22:16
Copy link
Contributor

@reneleonhardt reneleonhardt left a comment

Choose a reason for hiding this comment

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

Keep in mind, I'm no maintainer, they may have different opinions if they would review your feature.

version: http::Version::HTTP_11,
headers: http::header::HeaderMap::new(),
body: Bytes::new(),
body: Option::from(Bytes::new()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Some(Bytes::new()) would be easier to read, but what does Some empty body mean as long as nothing has been received yet?

Suggested change
body: Option::from(Bytes::new()),
body: None,

pub headers: HeaderMap,
pub body: Bytes,
pub body: Option<Bytes>,
pub body_lines_reader: Option<Arc<Mutex<LineReader>>>,
Copy link
Contributor

@reneleonhardt reneleonhardt Sep 9, 2025

Choose a reason for hiding this comment

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

Are really multiple threads mutating the reader at the same time?
Otherwise

Suggested change
pub body_lines_reader: Option<Arc<Mutex<LineReader>>>,
pub body_lines_reader: Option<Arc<LineReader>>,

should be enough, this seems sequential access only to me.
Without threads even Option<LineReader> should be working fine.

HTTP request body.
-D <BODY_PATH>
HTTP request body from file.
-Z <BODY_PATH_LINES>
Copy link
Contributor

Choose a reason for hiding this comment

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

I would feel better if all those conflicts/exclusions would be explained here (and in the actual help of course).

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