cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: POST call via proxy with authentication

From: Matteo Rocco <vanrock.web_at_gmail.com>
Date: Wed, 10 Jan 2007 15:45:31 +0100

>
> keepon == 2 means only KEEP_WRITE is set so it shouldn't go in there...
>
> So what exactly does libcurl do here then? I mean, you say it fails but
> how
> does it fail?
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>

With SQUID BASIC and ISA BASIC everything is ok and the callflow is:

Transfer
Curl_readwrite
Transfer
Curl_readwrite

With ISA NTLM (fail case) there is a loop like this:

Transfer
Curl_readwrite
Curl_readwrite
Curl_readwrite
...
...

This loop goes on to infinte interations because the function
Curl_readwrite(conn, &done)
never sets parameter done to true.
Transfer function returns when paremeter done becomes true

With ISA BASIC, SQUID BASIC, parameter done became true because:

in perhapsrewind function:
    k->size = 0; /* don't download any more than 0 bytes */

in Curl_readwrite function:
    if(-1 != k->size) {
          /* We do this operation even if no_body is true, since this
          data might be retrieved later with curl_easy_getinfo()
          and its CURLINFO_CONTENT_LENGTH_DOWNLOAD option. */

          Curl_pgrsSetDownloadSize(data, k->size);
          k->maxdownload = k->size;
      }

    /* If max download size is *zero* (nothing) we already
         have nothing and can safely return ok now! */
      if(0 == k->maxdownload)
          stop_reading = TRUE;

    if(stop_reading) {
          /* we make sure that this socket isn't read more now */
          k->keepon &= ~KEEP_READ;
      }

      .....

      /* Now update the "done" boolean we return */
      *done = (bool)(0 == (k->keepon&(KEEP_READ|KEEP_WRITE)));

hope you have understood the problem

Matteo
Received on 2007-01-10