raster pushed a commit to branch efl-1.20.

http://git.enlightenment.org/core/efl.git/commit/?id=fe62ed345b8de5b3431fa2e9d7bbbc01a7fb5473

commit fe62ed345b8de5b3431fa2e9d7bbbc01a7fb5473
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Tue Nov 7 22:41:20 2017 +0900

    efl net - handle proxy helper fails better and abort proxy lookups
    
    if proxy fails are too many then give up on queued lookups as they
    likely will continue. i noticed a process continually spawning efl net
    proxy helper because one queued lookup failed and could be looked up
    so it kept trying again and again.
    
    @fix
---
 src/lib/ecore_con/ecore_con_proxy_helper.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_con/ecore_con_proxy_helper.c 
b/src/lib/ecore_con/ecore_con_proxy_helper.c
index 43feead87e..c8ba462332 100644
--- a/src/lib/ecore_con/ecore_con_proxy_helper.c
+++ b/src/lib/ecore_con/ecore_con_proxy_helper.c
@@ -25,6 +25,7 @@ typedef struct {
    char              **proxies;
    int                 id;
    int                 busy;
+   int                 fails;
 } Efl_Net_Proxy_Helper_Req;
 
 typedef struct {
@@ -205,6 +206,7 @@ static Eina_Bool
 _efl_net_proxy_helper_cb_exe_del(void *data EINA_UNUSED, int type EINA_UNUSED, 
void *info)
 {
    Ecore_Exe_Event_Del *event = info;
+   int min_fails = 0;
 
    if (!_efl_net_proxy_helper_exe) return EINA_TRUE;
    if (event->exe == _efl_net_proxy_helper_exe)
@@ -222,10 +224,22 @@ _efl_net_proxy_helper_cb_exe_del(void *data EINA_UNUSED, 
int type EINA_UNUSED, v
                {
                   if ((t - last_respawn) > 5.0) respawn = EINA_TRUE;
                }
+             if (respawn)
+               {
+                  Eina_List *l;
+                  Efl_Net_Proxy_Helper_Req *req;
+
+                  EINA_LIST_FOREACH(_efl_net_proxy_helper_queue, l, req)
+                    {
+                       req->fails++;
+                       if (req->fails > min_fails) min_fails = req->fails;
+                    }
+               }
              locks--;
           }
         eina_spinlock_release(&_efl_net_proxy_helper_queue_lock);
-        if (respawn)
+        if (min_fails >= 5) _efl_net_proxy_helper_cancel();
+        else if (respawn)
           {
              last_respawn = t;
              _efl_net_proxy_helper_spawn();

-- 


Reply via email to