summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-08-29 14:49:03 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-08-30 00:35:35 -0300
commitfba2743361d5a149f9d9ccc7642dc209da523c01 (patch)
treecec9a0f8214ba7eb14d6d4a6cd18c367c33130a5
parent68ea5bd025a6582c96860ee875f4510d1f0d0c23 (diff)
efl_net_dialer_http: cancel curl multi timer when it's gone.
If we delete the curl multi handle, then we should stop any timer that was scheduled, otherwise it will use a dead or null pointer. also add some debug to help track down when the multi handle is deleted.
-rw-r--r--src/lib/ecore_con/efl_net_dialer_http.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/ecore_con/efl_net_dialer_http.c b/src/lib/ecore_con/efl_net_dialer_http.c
index d3a4b55e8e..f80bd4e31e 100644
--- a/src/lib/ecore_con/efl_net_dialer_http.c
+++ b/src/lib/ecore_con/efl_net_dialer_http.c
@@ -522,6 +522,9 @@ static void
522_efl_net_dialer_http_curlm_remove(Efl_Net_Dialer_Http_Curlm *cm, Eo *o, CURL *handle) 522_efl_net_dialer_http_curlm_remove(Efl_Net_Dialer_Http_Curlm *cm, Eo *o, CURL *handle)
523{ 523{
524 CURLMcode r = curl_multi_remove_handle(cm->multi, handle); 524 CURLMcode r = curl_multi_remove_handle(cm->multi, handle);
525
526 DBG("removed handle cm=%p multi=%p easy=%p: %s",
527 cm, cm->multi, handle, curl_multi_strerror(r));
525 if (r != CURLM_OK) 528 if (r != CURLM_OK)
526 { 529 {
527 ERR("could not unregister curl multi handle %p: %s", 530 ERR("could not unregister curl multi handle %p: %s",
@@ -531,8 +534,15 @@ _efl_net_dialer_http_curlm_remove(Efl_Net_Dialer_Http_Curlm *cm, Eo *o, CURL *ha
531 cm->users = eina_list_remove(cm->users, o); 534 cm->users = eina_list_remove(cm->users, o);
532 if (!cm->users) 535 if (!cm->users)
533 { 536 {
537 DBG("cleaned up cm=%p multi=%p", cm, cm->multi);
534 curl_multi_cleanup(cm->multi); 538 curl_multi_cleanup(cm->multi);
535 cm->multi = NULL; 539 cm->multi = NULL;
540
541 if (cm->timer)
542 {
543 efl_del(cm->timer);
544 cm->timer = NULL;
545 }
536 } 546 }
537} 547}
538 548