tags:

views:

29

answers:

1

Is there a way to make curl abort transfer, if average speed of transfer (during POST) is slower than X.X KB/s? Some transfers get really, really slow and I would want them to restart. One of the easier ways would be take size of content to be uploaded and divide it by expected speed and assign this value into --max-time parameter. But this would have to wait whole expected duration of transfer before it would abort...

I am using command-line version of curl, but I wouldn't mind if solution could be done (or work around) in any popular languages already built-in Linux such as perl or python :)

By the way -Y/--speed-limit <speed> didn't work for me, as it's probably only for download transfers.

+1  A: 

-Y works for both upload and download and is used in combination with -y to set a condition of when to abort.

Daniel Stenberg
Thanks! Although I tried it, and according to manual it should work like `-Y 1M` with 1M=1Megabytes, it didn't. With Bytes/second it however did. So thank you.
Andrew
What? I see nothing in the manual for -Y suggesting it supports such a suffix...
Daniel Stenberg