cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Incorrect file download on proxy authentication failure

From: Sourjo Basu <SourjoB_at_ami.com>
Date: Wed, 22 Oct 2008 16:15:41 -0400

>On Behalf Of Sourjo Basu
> Sent: Wednesday, October 22, 2008 2:56 PM
> To: curl-library_at_cool.haxx.se
> Subject: Incorrect file download on proxy authentication failure
>
>
> I am trying to use proxy to download a file from an ftp
> server. The proxy is a http type ISA server using basic
> authentication. When I provide the correct username and
> password for the proxy the correct file is downloaded. But
> when I provide an incorrect username and password then the
> error log is read into a file with the correct name but wrong
> content. Curl_easy_perform returns CURLE_OK which it should
> not since the proxy authentication failed. For example I am
> trying to download a test.c file which contains a few lines
> of code, but instead I get a xml type error log with that
> filename (test.c).
>
> I think libcurl should return an error (maybe #67
> CURLE_LOGIN_DENIED) instead of writing the error log to the
> file and saving it. I am attaching a verbose log of the
> transfer to this email and also the incorrect test.c file
> that was created in the download directory. I am using 7.18.2.
>
> Regards,
> Sourjo

I think I found the problem, I changed the return value of the
Curl_http_input_auth function in http.c from CURLE_OK to
CURLE_LOGIN_DENIED. Now my ftp app works without any problems for
incorrect proxy username/password. But I'm not sure what else this
change might affect, it is probably a hack for my specific need (proxy
auth). I would appreciate some input on this.

Regards,
Sourjo
Received on 2008-10-22