-
-
Notifications
You must be signed in to change notification settings - Fork 278
feat: add streaming mode for request body file #787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add streaming mode for request body file #787
Conversation
2d0c27d to
86df293
Compare
reneleonhardt
left a comment
There was a problem hiding this 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()), |
There was a problem hiding this comment.
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?
| 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>>>, |
There was a problem hiding this comment.
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
| 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> |
There was a problem hiding this comment.
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).
From #729