cURL / Mailing Lists / curl-library / Single Mail

curl-library

Stop of curl data transfer

From: Aaron shi <shiyou_at_nextbase.cn>
Date: Tue, 30 Oct 2007 12:39:44 +0800

Dear all:
    
    I have two questions:

    1) Possible reason of transfer stop?
    I am working on the mips embedded system which using libcurl to transfer photo data with server(http protocol).
    
    Because I want to know the progress of transfer,so I use progress_callback as follow:

    res = curl_easy_setopt(curl, CURLOPT_NOPROGRESS,0);
        res = curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,progress_callback);

    Sometime I found the progress stopped,like 10% ..., it always be that percentage.
    I know that is becase no reponse data form server. May be the physical network is disconnect.

    My platform using WIFI and DHCP to connnect with network. I search the web and see somebody say it's unstable of wifi dhcp connection.
    Is there another possible reason?

    2)How to solve this problem?

    I don't know how to handle this prolbem, the curl wait there for the server continuing response data...
    I try to use timeout option to solve this problem:
            
    long curl_timeout = GALLERY_CURL_TIMOUT_MINUTE*15;
        res = curl_easy_setopt(curl, CURLOPT_TIMEOUT,curl_timeout);
    
    For some reason I disable the SIGNAL using:
    res = curl_easy_setopt(curl, CURLOPT_NOSIGNAL,1);

    The problem is I find it seem like unprecise timeout. And the waiting time is still too long(For the normal operation,time cann't be set too small)

    
    Any sugguestion is thankful,^_^

BR
--------------
Aaron shi
shiyou_at_nextbase.cn
2007-10-30
Received on 2007-10-30