summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-10-05 13:07:14 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-10-05 13:07:14 +0000
commit433803e3dc055763a554fcc91ea36dabfac4575e (patch)
treef3483da2cc4aa07dc93dc26a36f38362c2dffc2b /legacy
parentd308248e4c6c9bc8b994682c2eaed8b977e1991a (diff)
ecore: let's try another approach thanks to Guillaume Friloux.
SVN revision: 77533
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ecore/src/lib/ecore_con/ecore_con_url.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_url.c b/legacy/ecore/src/lib/ecore_con/ecore_con_url.c
index 47d11e1..f98aa73 100644
--- a/legacy/ecore/src/lib/ecore_con/ecore_con_url.c
+++ b/legacy/ecore/src/lib/ecore_con/ecore_con_url.c
@@ -56,7 +56,7 @@ static CURLM *_curlm = NULL;
56static int _init_count = 0; 56static int _init_count = 0;
57static Ecore_Timer *_curl_timer = NULL; 57static Ecore_Timer *_curl_timer = NULL;
58static Eina_Bool pipelining = EINA_FALSE; 58static Eina_Bool pipelining = EINA_FALSE;
59 59Ecore_Idler *_curl_idler;
60#endif 60#endif
61 61
62/** 62/**
@@ -91,6 +91,7 @@ ecore_con_url_init(void)
91 91
92 _curl_timer = ecore_timer_add((double)ms / 1000, _ecore_con_url_timer, NULL); 92 _curl_timer = ecore_timer_add((double)ms / 1000, _ecore_con_url_timer, NULL);
93 ecore_timer_freeze(_curl_timer); 93 ecore_timer_freeze(_curl_timer);
94 _curl_idler = NULL;
94 95
95 return _init_count; 96 return _init_count;
96#else 97#else
@@ -114,6 +115,9 @@ ecore_con_url_shutdown(void)
114 _curl_timer = NULL; 115 _curl_timer = NULL;
115 } 116 }
116 117
118 if (_curl_idler) ecore_idler_del(_curl_idler);
119 _curl_idler = NULL;
120
117 EINA_LIST_FREE(_url_con_list, url_con) 121 EINA_LIST_FREE(_url_con_list, url_con)
118 ecore_con_url_free(url_con); 122 ecore_con_url_free(url_con);
119 EINA_LIST_FREE(_fd_hd_list, fd_handler) 123 EINA_LIST_FREE(_fd_hd_list, fd_handler)
@@ -1335,7 +1339,7 @@ _ecore_con_url_event_url_complete(Ecore_Con_Url *url_con, CURLMsg *curlmsg)
1335 1339
1336 e->status = status; 1340 e->status = status;
1337 e->url_con = url_con; 1341 e->url_con = url_con;
1338 1342
1339 url_con->event_count++; 1343 url_con->event_count++;
1340 ecore_event_add(ECORE_CON_EVENT_URL_COMPLETE, e, (Ecore_End_Cb)_ecore_con_event_url_free, url_con); 1344 ecore_event_add(ECORE_CON_EVENT_URL_COMPLETE, e, (Ecore_End_Cb)_ecore_con_event_url_free, url_con);
1341} 1345}
@@ -1549,6 +1553,9 @@ _ecore_con_url_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __
1549 1553
1550 ecore_timer_interval_set(_curl_timer, (double)ms / 1000); 1554 ecore_timer_interval_set(_curl_timer, (double)ms / 1000);
1551 1555
1556 if (!_curl_timer)
1557 _curl_idler = ecore_idler_add(_ecore_con_url_timer, NULL);
1558
1552 return ECORE_CALLBACK_CANCEL; 1559 return ECORE_CALLBACK_CANCEL;
1553} 1560}
1554 1561
@@ -1611,6 +1618,8 @@ _ecore_con_url_timer(void *data __UNUSED__)
1611 ERR("curl_multi_perform() failed: %s", curl_multi_strerror(ret)); 1618 ERR("curl_multi_perform() failed: %s", curl_multi_strerror(ret));
1612 _ecore_con_url_curl_clear(); 1619 _ecore_con_url_curl_clear();
1613 ecore_timer_freeze(_curl_timer); 1620 ecore_timer_freeze(_curl_timer);
1621 if (_curl_idler) ecore_idler_del(_curl_idler);
1622 _curl_idler = NULL;
1614 } 1623 }
1615 1624
1616 if (still_running) 1625 if (still_running)
@@ -1628,6 +1637,8 @@ _ecore_con_url_timer(void *data __UNUSED__)
1628 _ecore_con_url_info_read(); 1637 _ecore_con_url_info_read();
1629 _ecore_con_url_curl_clear(); 1638 _ecore_con_url_curl_clear();
1630 ecore_timer_freeze(_curl_timer); 1639 ecore_timer_freeze(_curl_timer);
1640 if (_curl_idler) ecore_idler_del(_curl_idler);
1641 _curl_idler = NULL;
1631 } 1642 }
1632 1643
1633 return ECORE_CALLBACK_RENEW; 1644 return ECORE_CALLBACK_RENEW;