title: Curl's CURLOPT_XFERINFOFUNCTION callback returns dlnow > dltotal
body: <p>I've been using CURL for all HTTP communication. I need a to know when the server is done sending me a response. According to the CURL documentation CURLOPT_XFERINFOFUNCTION is designed to do just that. </p>
  
  <p>However, every time the callback function get hit, all the arguments are either all 0, or all 0 besides dlnow which is 233. This is not the expected behavior, and i haven't found people with a similar problem after googling. </p>
  
  <p>Callback initiation:</p>
  
  <pre><code>curl_easy_setopt(handle, CURLOPT_XFERINFOFUNCTION, CLibCurlThreadTask::CurlProgress);
  curl_easy_setopt(handle, CURLOPT_NOPROGRESS, 0L);
  </code></pre>
  
  <p>Callback function:</p>
  
  <pre><code>int CLibCurlThreadTask::CurlProgress(void *clientp,   curl_off_t dltotal,   curl_off_t dlnow,   curl_off_t ultotal,   curl_off_t ulnow)
  {   
  if( dltotal &gt; 0 || dlnow &gt; 0 || ultotal &gt; 0 || ulnow &gt; 0)
      {
          CryLogAlways("UP: %" CURL_FORMAT_CURL_OFF_T " of %" CURL_FORMAT_CURL_OFF_T "  DOWN: %" CURL_FORMAT_CURL_OFF_T " of %" CURL_FORMAT_CURL_OFF_T "\r\n", ulnow, ultotal, dlnow, dltotal);
      }   
      return CURLE_OK;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>UP: 0 of 0  DOWN: 233 of 0</p>
    
    <p>UP: 0 of 0  DOWN: 233 of 0</p>
    
    <p>UP: 0 of 0  DOWN: 233 of 0</p>
    
    <p>UP: 0 of 0  DOWN: 233 of 0</p>
  </blockquote>