diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2017-11-07 22:41:20 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2017-11-07 22:42:49 +0900 |
commit | ede0587887704fc166e1631304f660e703e3489b (patch) | |
tree | b992865f903868e8c4d5c6996a0517a852ceea5d | |
parent | a0dc0eb5161f88507e3e44bb426ac26245aa6847 (diff) |
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
-rw-r--r-- | src/lib/ecore_con/ecore_con_proxy_helper.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/ecore_con/ecore_con_proxy_helper.c b/src/lib/ecore_con/ecore_con_proxy_helper.c index ff0253f055..c313b4d4f7 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 { | |||
25 | char **proxies; | 25 | char **proxies; |
26 | int id; | 26 | int id; |
27 | int busy; | 27 | int busy; |
28 | int fails; | ||
28 | } Efl_Net_Proxy_Helper_Req; | 29 | } Efl_Net_Proxy_Helper_Req; |
29 | 30 | ||
30 | typedef struct { | 31 | typedef struct { |
@@ -205,6 +206,7 @@ static Eina_Bool | |||
205 | _efl_net_proxy_helper_cb_exe_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *info) | 206 | _efl_net_proxy_helper_cb_exe_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *info) |
206 | { | 207 | { |
207 | Ecore_Exe_Event_Del *event = info; | 208 | Ecore_Exe_Event_Del *event = info; |
209 | int min_fails = 0; | ||
208 | 210 | ||
209 | if (!_efl_net_proxy_helper_exe) return EINA_TRUE; | 211 | if (!_efl_net_proxy_helper_exe) return EINA_TRUE; |
210 | if (event->exe == _efl_net_proxy_helper_exe) | 212 | 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 | |||
222 | { | 224 | { |
223 | if ((t - last_respawn) > 5.0) respawn = EINA_TRUE; | 225 | if ((t - last_respawn) > 5.0) respawn = EINA_TRUE; |
224 | } | 226 | } |
227 | if (respawn) | ||
228 | { | ||
229 | Eina_List *l; | ||
230 | Efl_Net_Proxy_Helper_Req *req; | ||
231 | |||
232 | EINA_LIST_FOREACH(_efl_net_proxy_helper_queue, l, req) | ||
233 | { | ||
234 | req->fails++; | ||
235 | if (req->fails > min_fails) min_fails = req->fails; | ||
236 | } | ||
237 | } | ||
225 | locks--; | 238 | locks--; |
226 | } | 239 | } |
227 | eina_spinlock_release(&_efl_net_proxy_helper_queue_lock); | 240 | eina_spinlock_release(&_efl_net_proxy_helper_queue_lock); |
228 | if (respawn) | 241 | if (min_fails >= 5) _efl_net_proxy_helper_cancel(); |
242 | else if (respawn) | ||
229 | { | 243 | { |
230 | last_respawn = t; | 244 | last_respawn = t; |
231 | _efl_net_proxy_helper_spawn(); | 245 | _efl_net_proxy_helper_spawn(); |