alexcrichton/tokio-curl

A multiform request causes tokio-curl to get stuck

bytesnake opened this issue · 5 comments

I'm trying to upload a large file by a multiform request. When tokio-curl attempts to upload the file content, it will always wait for an answer from the server to continue after the first packet. Rust-curl uploads the packets without awaiting some responds though.

Example

Thanks for the report! I tested this out locally sending the payload to http://httpbin.com/post but was unfortunately unable to reproduce. What server were you using locally to test this against? That may help me to reproduce and dig into what's going on.

Well, I've prototyped a rust bot library based on curl. Everything is working fine except uploading a file larger than 32kB (?). I've already tried to disable the except header but the bot server confirms the header and it accepts a small file without any problem.
To reproduce the case you will need a telegram bot api key, here is a small test: https://gist.github.com/anonymous/3f70dee7f0f689034d6accac6a98f435
I created a example server with netcat and observed the behaviour of curl. Sometimes it's easier to illustrate:

tokio-curl:
ex1

rust-curl:
ex2

Did I miss something or is this an intended behaviour? It seems like the event loop awaits a new incoming packet before sending the next one.

Thanks for the info! I've been able to reproduce locally, and I think that de0ecf3 should fix the problem. Could you test it out though and confirm that it works?

jep upload is working now, you're awesome, thanks!

Ok, I've published 0.3.6 with these changes, thanks for testing!