cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Digest authentication

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sun, 27 Mar 2005 14:53:41 +0200 (CEST)

On Fri, 25 Mar 2005, Tom Moers wrote:

> When doing a HTTP post with digest authentication libcurl first sends an
> empty post.

Nope, it does not. It did though. Or perhaps your server rejected the POST
before curl was able to send anything?

> Then a 401 reponse is received after which curl closes the connection. Curl
> opens a new connection and sends a new post this time with the content and
> credentials.
>
> It seems that perhapsrewind() decides to close the connection even if no
> bytes are sent in the first empty post.
>
> Is this intended behaviour?
> Why doesn't curl reuse the HTTP connection?

Because to be able to reuse the connection, it would have to send the whole
POST first, only to get it discarded by the server. Then it could reuse the
connection and send the post data properly with the correct credentials. curl
rather closes the connection and reopons it if the post data is larger than
2000 bytes.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-03-27