summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bouchaud (yoz) <yoz@efl.so>2019-01-13 15:51:32 +0100
committerMichael Bouchaud (yoz) <yoz@efl.so>2019-01-13 16:08:20 +0100
commit1f6ac237a149e29dff5eefb73211e451e6d99d79 (patch)
treea40fb5a192b641866b6043424d8e62cf35e9283b
parent4ea6bfa3d62143f24790b382b988dc6458fe79dd (diff)
Don't loop infinitely when we got an error on search request (http_code != 200)
-rw-r--r--src/plugin.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 4f7f66e..2b442ae 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -191,7 +191,15 @@ _url_search_complete(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
191 191
192 if (data != ecore_con_url_data_get(ev->url_con)) return ECORE_CALLBACK_PASS_ON; 192 if (data != ecore_con_url_data_get(ev->url_con)) return ECORE_CALLBACK_PASS_ON;
193 DBG("Url search complete %d", ev->status); 193 DBG("Url search complete %d", ev->status);
194 if (ev->status != 200) return ECORE_CALLBACK_DONE; 194 if (ev->status != 200)
195 {
196 _sr->plugins = eina_list_next(_sr->plugins);
197 if (_sr->plugins)
198 _weather_plugin_search_next();
199 else
200 _weather_plugin_search_done();
201 return ECORE_CALLBACK_DONE;
202 }
195 203
196 buf = eina_binbuf_string_get(_sr->buffer); 204 buf = eina_binbuf_string_get(_sr->buffer);
197 size = eina_binbuf_length_get(_sr->buffer); 205 size = eina_binbuf_length_get(_sr->buffer);
@@ -291,6 +299,7 @@ weather_plugin_search(const char *city, const char *country, Weather_Plugin_Sear
291 _sr->city = eina_stringshare_add(city); 299 _sr->city = eina_stringshare_add(city);
292 _sr->country = eina_stringshare_add(country); 300 _sr->country = eina_stringshare_add(country);
293 _sr->cb = cb; 301 _sr->cb = cb;
302 _sr->ws = NULL;
294 _sr->data = data; 303 _sr->data = data;
295 _sr->plugins = plugins; 304 _sr->plugins = plugins;
296 E_LIST_HANDLER_APPEND(_sr->handlers, ECORE_CON_EVENT_URL_COMPLETE, 305 E_LIST_HANDLER_APPEND(_sr->handlers, ECORE_CON_EVENT_URL_COMPLETE,