title: C - libcurl - How to get dltotal without using the CURLOPT_XFERINFOFUNCTION
body: <p>I am using the <strong>libcurl</strong> multi interface and I need to know how much data is being sent for each request. I would rather not use the <code>CURLOPT_XFERINFOFUNCTION</code> because it gets called a lot and I only need to know the dltotal while I am in the <code>CURLOPT_WRITEFUNCTION</code> callback. I want to clean up the existing easy handle and malloc'd data while I am still in the write callback once all the data has been received. Is there a function I can call that will return the total amount of data that is being sent for a particular easy handle?</p>
  
  <p>I tried using <code>curl_easy_getinfo()</code> with <code>CURLINFO_SIZE_DOWNLOAD</code> and it always returned <strong>0</strong>. I also tried <code>CURLINFO_CONTENT_LENGTH_DOWNLOAD</code> which also always returned <strong>0</strong>. I was calling this from within the  <code>CURLOPT_WRITEFUNCTION</code> callback.</p>