cURL / Mailing Lists / curl-users / Single Mail

curl-users

Handling Multi-URL transfers with Failed Authentication

From: Robert Bednar <boborama_at_embarqmail.com>
Date: Thu, 5 Jul 2012 17:06:58 -0400

Sorry if this isn't going through official channels. I'll strive to find the official forum for such questions in the future.
I have some systems which have a painfully slow connection due to reverse DNS restrictions I have no control over.

I was performing discreet transfers of a dozen or so files - attempting an ftp transfer on each file one at a time and checking the exit code.
If run as "separate" Curl statements, each one required the 30-second penalty on reverse DNS.
To get around the reverse DNS bottle neck I "stacked up" all my files into a single multi file transfer. This awesome. I did presume it would add extra difficulty checking the return code/s ….but really…my only real problem is username and password credentials.

My curl statement is something like this…

curl -u username:password ftp://192.168.123.1//home/mydir/{onefile,twofile,threefile,fourfile} -O -O -O

The problem is that if my username and password credentials fail… curl tries each file subsequently with the same username and password that failed the first time. This wouldn't normally be an issue except it takes about 30 seconds to "connect" to the ftp server. Since the connection is ultimately "refused" I wait 30 seconds for EACH file in the multi-file request before my calling script gets a return code..and calls someone a bonehead for supplying the wrong password. This time can really add up.

I'd like curl to "understand" that retrying the same rejected username and password on subsequent multi-file requests isn't going to work - and exit pronto.

R. Bednar
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-05