Repository navigation
Conversation
Tratcher
left a comment
There was a problem hiding this comment.
An ambitious start, but mutlipart is much more work to parse efficiently than form data.
|
@Tratcher I will try to address all the comments you added and create a commit. I noticed a few bugs when I updated the tests and already began work on fixing some of what you mentioned. |
gfoidl
left a comment
There was a problem hiding this comment.
Move all know delimiters (end of line, colon, ...) to static fields.
|
I think that I got the hang of PipeReader. This update should work relatively well and it should take into account most of the differences between a Stream and a PipeReader, it also passes all tests. Issues
Still to be done
Suggestions
|
|
I added an IOException when there is not enough data to comply with the failing test - however it still fails because I do things a little differently than the MultipartReaderStream. |
|
I think I created something that is somewhat production ready. I need to create the Performance tests to make sure that this is an improvement. |
|
I updated FormFeature to use MultipartPipeReader, however the test won't pass when buffering isn't enabled - the reason for this is that I always set a BaseStreamOffset (since I can't set a position on MultipartPipeReaderStream, because PipeReaders don't support it) - Now since the test use NonSeekableStream as the body, which their position also cannot be set, the tests fail. I am not really sure how to address this issue, and your guidance would be appreciated. |
|
@Tratcher any update on what should I do next? Specifically regarding the tests that aren't passing? and what do you think about updating FormMultipartSection to take advantage of pipeReader? |
jkotalik
left a comment
There was a problem hiding this comment.
Did you manage to get perf numbers? Curious how this is looking.
Clean up cancellation.
|
@gilmishal thanks for the effort you put into this, but I don't think any of us have the time to finish it right now. I'm going to close this PR until we can come back to it. |
|
@Tratcher If I do find time to try and work on it, should I work on it? What's left to do? |
|
Go head. You'll want to pick up my branch though, it had some changes I hadn't pushed here. I don't remember the details, it's been too long since I worked on it, but there were still some failing test cases. |
|
@gilmishal I have some ideas. I think we should do this still, if you're willing, lets design the API and start another PR. I don't think this was too far off but to take more baby steps I think we should do a fully streaming API and not touch the FormFeature to begin with. We should design a more efficient version of the existing |
|
@davidfowl I am not sure if this is still relevant, but I would love to pick this up again. However I think we should do it differently this time and verify we are on the same page before I start working on it again. Should I come up with a design and let you review it? Should we work on one together? Do you have a design that I can follow? |
|
FYI I still have the old version in a branch: Yes it's still relevant, and as David said, if we can start with the lowest level APIs (e.g. MultipartReader) to make sure those are solid, then we can work up from there. |
|
@Tratcher I started working on it. Anyways, I got most of the tests working - but I do have quite a bit of questions before I can continue. Should I create a new PR and shall we discuss the next steps there? |
|
Hi @gilmishal. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
|
@gilmishal if you have design questions then please start with an issue. If you have code questions then open a draft PR. |
|
Hi @Tratcher. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |

Summary of the changes (Less than 80 chars)
MultipartPipeReaderbased onFormPipeReaderandMultipartReaderRemaining
FromPipeReaderto insure reads in different memory scenariosFormFeatureto use the newMultipartPipeReaderNot Sure
MultipartReaderReturns aMultipartSectionwith a Stream as Body - I believe the stream capabilities should remain to not create a breaking change - I created a memory stream which might be costly in terms of performance, and I think I should probably create a stream similar to the buffered stream - If you have any other ideas including getting rid of the stream altogether I can do that.ReadonlySequence<>and I would suggest creating some sort of a utility class that handles these reads (should probably affectFormPipeReadertoo)Addresses #11377 (in this specific format)