cURL / Mailing Lists / curl-users / Single Mail

curl-users

cURL hangs when downloading a CSV file from behind a proxy

From: Adam Larsen <aplarsen_at_gmail.com>
Date: Fri, 12 Apr 2013 19:26:03 -0500

I'm using the 64-bit command line executable version of cURL on a Windows 7
machine.

The goal here is to download a CSV of transaction histories from PayPal,
and the batch file I've put together is working quite well. It logs in,
posts the form, receives the CSV data, but then it hangs. It never seems
to finish, even though the output says it is at 100%, and my file itself is
actually complete. That is, I have all of the data I need, but cURL never
moves on.

Here is the command:

curl\curl.exe ^
--proxy proxy1:8080 ^
--proxy-ntlm ^
--proxy-user DOMAIN\user:pass ^
--cookie-jar cookies.txt ^
--cookie cookies.txt ^
--location-trusted ^
--output data.csv ^
--user-agent 'Mozilla/5.0' ^
--insecure ^
--data cmd=_history-download-submit ^
--data history_cache= ^
--data type=custom_date_range ^
--data from_a=1 ^
--data from_b=1 ^
--data from_c=2013 ^
--data to_a=4 ^
--data to_b=12 ^
--data to_c=2013 ^
--data custom_file_type=comma_allactivity ^
--data latest_completed_file_type= ^
--data submit.x=Download+History ^
--data form_charset=UTF-8 ^
--data include_shopping_cart_detail=1 ^
https://history.paypal.com/us/cgi-bin/webscr

You will notice I am behind a proxy. This environment uses MS Forefront
TMG. I would not be the least bit surprised if my hangup is caused by the
proxy, given some problems we have with it. That, and, this thread seems
to suggest a possible bug when using NTLM.
http://curl.haxx.se/mail/lib-2007-03/0063.html. I don't have the option of
rebuilding cURL, so his fix can't work for me.

If I add this argument...
--speed-time 1
...I can get the operation to cease as soon as the remote server stops
sending data, but that seems risky, given that a sudden blip in my
connection could result in not all of the data being sent over.

These files are small, so I can set a timeout or max file size and be
pretty sure I downloaded everything, but I'd like to avoid that sort of
kludge.

Any ideas? Thanks.

Adam P. Larsen
aplarsen_at_gmail.com

-------------------------------------------------------------------
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 2013-04-13