cURL / Mailing Lists / curl-library / Single Mail

curl-library

HTTP POST Progress Callback

From: Íèêèòà Äîðîõèí <kit-d_at_ukr.net>
Date: Tue, 13 Apr 2010 15:11:21 +0300
('binary' encoding is not supported, stored as-is)

Hi,
  
I'm working with libcurl 7.20.0 (pure C) and trying to upload 16K file with HTTP POST.
I use these options:
  
        curl_easy_setopt(m_curl, CURLOPT_POST, 1L);
        curl_easy_setopt(m_curl, CURLOPT_POSTFIELDS, fileData);
        curl_easy_setopt(m_curl, CURLOPT_POSTFIELDSIZE, fileSize);
  
Also I've defined progress callback with CURLOPT_PROGRESSFUNCTION and expect upload bytes counters there. But I get some incorrect values there.
Here is my debug output:
  
[04/13/10 07:40:18], Sending UploadFile message (12270 bytes) to server
[04/13/10 07:40:18], Uploaded 12270.000000 bytes of 0.000000 bytes
[04/13/10 07:40:18], Uploaded 12270.000000 bytes of 0.000000 bytes
[04/13/10 07:40:19], Uploaded 12270.000000 bytes of 0.000000 bytes
[04/13/10 07:40:20], Uploaded 12270.000000 bytes of 0.000000 bytes
[04/13/10 07:40:20], Uploaded 12270.000000 bytes of 0.000000 bytes
[04/13/10 07:40:20], Uploaded 12270.000000 bytes of 0.000000 bytes
  
I look into the code an I think there is a bug in http.c Curl_http() function.
It doesn't invoke Curl_pgrsSetUploadSize when upload size is for less then MAX_INITIAL_POST_SIZE.
  
Please let me know if it does make sense.
  
Thanks a lot,
Nikita
  

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-13