forked from enlightenment/efl
ecore ecore_con_url.c: Applied ui interactoin bug fix patch from Kim
Yunhan <spbear@gmail.com> On Wed, Sep 21, 2011 at 10:51 PM, Kim Yunhan <spbear@gmail.com> wrote: > Hello! > > elm_map uses Ecore Con with CURL. > I tested elm_map many times on my device. > But sometimes UI interaction is held when data connection is poor. > So I tried to debug and I found that this code lead to hold an Ecore main > loop. > > ---------------------------------------------- > In ecore_con_url.c > > while (curl_multi_perform(_curlm, &still_running) == > CURLM_CALL_MULTI_PERFORM) ; > ---------------------------------------------- > > curl_multi_perform() is CURL's asynchronous API. > But above code hold an Ecore main loop. > When it takes long time in libcurl, UI interaction is delayed. > > For example, If you have poor data connection. > libcurl is trying to resolve DNS in this step. > But it have to wait until timeout. > At that time it looks like being locked. > > So I write a patch for fixing it. SVN revision: 63636
This commit is contained in:
parent
881244542d
commit
c8a62c0cb2
|
@ -1357,14 +1357,20 @@ _ecore_con_url_perform(Ecore_Con_Url *url_con)
|
||||||
int fd_max, fd;
|
int fd_max, fd;
|
||||||
int flags, still_running;
|
int flags, still_running;
|
||||||
int completed_immediately = 0;
|
int completed_immediately = 0;
|
||||||
|
double start;
|
||||||
CURLMcode ret;
|
CURLMcode ret;
|
||||||
|
|
||||||
_url_con_list = eina_list_append(_url_con_list, url_con);
|
_url_con_list = eina_list_append(_url_con_list, url_con);
|
||||||
|
|
||||||
url_con->active = EINA_TRUE;
|
url_con->active = EINA_TRUE;
|
||||||
curl_multi_add_handle(_curlm, url_con->curl_easy);
|
curl_multi_add_handle(_curlm, url_con->curl_easy);
|
||||||
/* This one can't be stopped, or the download never start. */
|
|
||||||
while (curl_multi_perform(_curlm, &still_running) == CURLM_CALL_MULTI_PERFORM) ;
|
start = ecore_time_get();
|
||||||
|
while (curl_multi_perform(_curlm, &still_running) == CURLM_CALL_MULTI_PERFORM)
|
||||||
|
if ((ecore_time_get() - start) > (0.7 * ecore_animator_frametime_get()))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
completed_immediately = _ecore_con_url_process_completed_jobs(url_con);
|
completed_immediately = _ecore_con_url_process_completed_jobs(url_con);
|
||||||
|
|
||||||
|
@ -1456,7 +1462,7 @@ _ecore_con_url_idler_handler(void *data)
|
||||||
start = ecore_time_get();
|
start = ecore_time_get();
|
||||||
while (curl_multi_perform(_curlm, &still_running) == CURLM_CALL_MULTI_PERFORM)
|
while (curl_multi_perform(_curlm, &still_running) == CURLM_CALL_MULTI_PERFORM)
|
||||||
/* make this not more than a frametime to keep interactivity high */
|
/* make this not more than a frametime to keep interactivity high */
|
||||||
if ((ecore_time_get() - start) > ecore_animator_frametime_get())
|
if ((ecore_time_get() - start) > (0.7 * ecore_animator_frametime_get()))
|
||||||
{
|
{
|
||||||
done = 0;
|
done = 0;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue