cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: POST file twice over NTLM-proxy

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 9 Jan 2007 10:18:26 +0100 (CET)

On Tue, 9 Jan 2007, Andrew Klukvin wrote:

> I'm using curl_formadd and POST-method to send file via proxy with
> NTLM-auth. Looking on ProgressFunction, I see that my file send twice
> (probably because of NTLM-specific). Am I right or not?

You are right. There's no way to avoid that when using NTLM, since we can't
abort the transfer once it has started.

> P.S. Previously I use my own library where I try to authorize using
> HEAD-method (I ask for new login every time when error 407 occured) and then
> send data with POST-method. May be this is preferred algorithm but I want
> using libcurl in my project. And may be I need to use curl in the same way?

You could indeed use that method with libcurl too, and it sounds like a smart
way to avoid the extra round-trip. libcurl used to do that HEAD-trick by
itself in the past, but since it isn't the correct way in all situations we
had to change libcurl to work as it does and leave the imaginativework-arounds
(with HEAD or otherwise) to the app.

Do note that there's nothing in general that guarantees that HEAD will work on
the same URL as you POST to... (or even that it would use the same auth).

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-01-09