magiclen / rocket-multipart-form-data

This crate provides a multipart parser for the Rocket framework.
MIT License
35 stars 14 forks source link

Ignore WouldBlock I/O error kind #11

Open arnodb opened 3 years ago

arnodb commented 3 years ago

Hi, this change allows to fix some WouldBlock errors while parsing multipart data. This only relates to Rocket 0.4, 0.5 is apparently not affected.

I theory this should be fixed in either Hyper or Rocket, but Hyper is outdated and Rocket 0.4 is not very active (which I can understand), I'm looking forward to seeing 0.5 out. In the meanwhile, there is this tiny change which at least covers our issue with multipart upload.

In order to test that I used dd if=/dev/zero bs=1000000 count=2 | pv -L 3k | curl -k 'https://localhost:8000' -v -F file=@/dev/stdin.

Artificially limiting the bandwidth (with pv) is the key to reproduce the problem.

PR open to suggestions.