cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Why does ultotal stay at 0 in progress callback function?

From: Saqib Ali <saqib.ali.75_at_gmail.com>
Date: Fri, 18 Mar 2011 15:49:42 -0400

When I run it, the callback gets called, but ultotal=0 and remains at 0,
>> even as ulnow increases:
>>
>> Does anyone know why my ultotal is staying at 0? It should be the size of
>> the uploaded file. The file is successfully transferred.
>>
>
> No, I don't know. It sounds wrong. If the size of the file is known already
> and told to libcurl, that should be the size passed in...
>
>

Ok, I was only partially incorrect in my original question. The ultotal
doesn't stay at 0. It does go up to the correct value. But it *does* start
at zero. See below. I'm hoping that the state transitions shown by verbose
combined with my printfs will be good clues as to what is going on. This may
be perfectly normal behavior. But it would be nice to get confirmation of
that.

* SSH CONNECT phase done
* SFTP 0x65010 state change from SSH_SFTP_REALPATH to SSH_STOP
* STATE: PROTOCONNECT => DO handle 0x47080; (connection #0)

********************************************************************************
        From within progressCallBack()
        dltotal=0, dlnow=0, ultotal=0, ulnow=0
********************************************************************************

* DO phase starts
* SFTP 0x65010 state change from SSH_STOP to SSH_SFTP_QUOTE_INIT
* SFTP 0x65010 state change from SSH_SFTP_QUOTE_INIT to SSH_SFTP_TRANS_INIT
* SFTP 0x65010 state change from SSH_SFTP_TRANS_INIT to SSH_SFTP_UPLOAD_INIT
* STATE: DO => DOING handle 0x47080; (connection #0)

********************************************************************************
        From within progressCallBack()
        dltotal=0, dlnow=0, ultotal=0, ulnow=0
********************************************************************************

stillRunning = 1 curl_multi_perform() == 0
* SFTP 0x65010 state change from SSH_SFTP_UPLOAD_INIT to SSH_STOP
* DO phase is complete
* STATE: DOING => DO_DONE handle 0x47080; (connection #0)

********************************************************************************
        From within progressCallBack()
        dltotal=0, dlnow=0, ultotal=1228, ulnow=0
********************************************************************************

- Saqib

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-18