summaryrefslogtreecommitdiff
path: root/src/lib/efreet
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-12-26 13:06:35 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-12-26 13:06:35 +0900
commita6f7b0f834fe7278fd7125e0d89f1cc570d616ed (patch)
treeeb2253a2f0f99942aee94217eee219ccb92b57dd /src/lib/efreet
parent44a70ab98ce0814b2090e2dff015631cb5ec5555 (diff)
efreet cache - handle corner case where efreetd keeps disconnecting
so an odd one. there is a socket, but nothing is actually listening on it, but clients keep spinning launching efreetd's because the launch, connect, then get a disconnect and try again immediately keeping things spinning heavily, so add a delay of 0.5 sec before launchnig another efreetd if the launch + connect fails and gets a disconnect within 0.5 sec ... so give up for 0.5 sec before trying again to avoid a runaway system. @fix
Diffstat (limited to 'src/lib/efreet')
-rw-r--r--src/lib/efreet/efreet_cache.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index de4ca7440e..82ceaca802 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -132,11 +132,13 @@ _cb_server_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
132 return ECORE_CALLBACK_DONE; 132 return ECORE_CALLBACK_DONE;
133} 133}
134 134
135static Ecore_Timer *reconnect_timer = NULL;
136
135static Eina_Bool 137static Eina_Bool
136_cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) 138_cb_server_reconnect(void *data EINA_UNUSED)
137{ 139{
138 IPC_HEAD(Del); 140 if (reconnect_timer) ecore_timer_del(reconnect_timer);
139 ipc = NULL; 141 reconnect_timer = NULL;
140 _ipc_launch(); 142 _ipc_launch();
141 if (ipc) 143 if (ipc)
142 { 144 {
@@ -148,6 +150,25 @@ _cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
148 ecore_ipc_server_send(ipc, 1, 0, 0, 0, 0, s, len); 150 ecore_ipc_server_send(ipc, 1, 0, 0, 0, 0, s, len);
149 efreet_icon_extensions_refresh(); 151 efreet_icon_extensions_refresh();
150 } 152 }
153 return EINA_FALSE;
154}
155
156static Eina_Bool
157_cb_server_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
158{
159 static double last_del = 0.0;
160 double t;
161 IPC_HEAD(Del);
162 ipc = NULL;
163 t = ecore_time_get();
164 if ((t - last_del) < 0.5)
165 {
166 if (reconnect_timer) ecore_timer_del(reconnect_timer);
167 reconnect_timer = ecore_timer_add(0.5, _cb_server_reconnect, NULL);
168 }
169 else
170 _cb_server_reconnect(NULL);
171 last_del = t;
151 return ECORE_CALLBACK_DONE; 172 return ECORE_CALLBACK_DONE;
152} 173}
153 174