diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2014-03-18 12:11:35 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2014-03-18 13:49:05 +0900 |
commit | 320a9f18c55e3e281b374eb757e22a065d911c09 (patch) | |
tree | 15b2d1c215d9fb6e6abe567a70d1e889c564ba1c | |
parent | ff2d598b029bec988b4c2ac5fbeeee1f80700335 (diff) |
Evas cserve2: Fix client crashes when a file changed
Clients must ignore changed file entries as they are not valid
anymore. The server will also mark the entry as invalid in case
of file update.
@fix
Diffstat (limited to '')
-rw-r--r-- | src/bin/evas/evas_cserve2_cache.c | 1 | ||||
-rw-r--r-- | src/lib/evas/cserve2/evas_cs2_client.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/evas/evas_cserve2_cache.c b/src/bin/evas/evas_cserve2_cache.c index 0c2a5bee73..7acf201d98 100644 --- a/src/bin/evas/evas_cserve2_cache.c +++ b/src/bin/evas/evas_cserve2_cache.c | |||
@@ -1712,6 +1712,7 @@ _file_changed_cb(const char *path EINA_UNUSED, Eina_Bool deleted EINA_UNUSED, vo | |||
1712 | if (fd) | 1712 | if (fd) |
1713 | { | 1713 | { |
1714 | fd->changed = EINA_TRUE; | 1714 | fd->changed = EINA_TRUE; |
1715 | fd->valid = EINA_FALSE; | ||
1715 | _file_id_free(fd); | 1716 | _file_id_free(fd); |
1716 | eina_hash_set(file_entries, &fd->id, NULL); | 1717 | eina_hash_set(file_entries, &fd->id, NULL); |
1717 | } | 1718 | } |
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c index 2476e915ad..d532644113 100644 --- a/src/lib/evas/cserve2/evas_cs2_client.c +++ b/src/lib/evas/cserve2/evas_cs2_client.c | |||
@@ -2735,7 +2735,9 @@ _shared_image_entry_file_data_find(Image_Entry *ie) | |||
2735 | if (fe->server_file_id) | 2735 | if (fe->server_file_id) |
2736 | { | 2736 | { |
2737 | if ((fdata = _shared_file_data_get_by_id(fe->server_file_id)) != NULL) | 2737 | if ((fdata = _shared_file_data_get_by_id(fe->server_file_id)) != NULL) |
2738 | return fdata; | 2738 | if (!fdata->changed) |
2739 | return fdata; | ||
2740 | fe->server_file_id = 0; | ||
2739 | } | 2741 | } |
2740 | 2742 | ||
2741 | // Check hash | 2743 | // Check hash |
@@ -2757,6 +2759,7 @@ _shared_image_entry_file_data_find(Image_Entry *ie) | |||
2757 | fd = &(_index.files.entries.filedata[k]); | 2759 | fd = &(_index.files.entries.filedata[k]); |
2758 | if (!fd->id) break; | 2760 | if (!fd->id) break; |
2759 | if (!fd->refcount) continue; | 2761 | if (!fd->refcount) continue; |
2762 | if (fd->changed) continue; | ||
2760 | 2763 | ||
2761 | key = _shared_string_safe_get(fd->key); | 2764 | key = _shared_string_safe_get(fd->key); |
2762 | file = _shared_string_safe_get(fd->path); | 2765 | file = _shared_string_safe_get(fd->path); |
@@ -3097,6 +3100,7 @@ _shared_image_entry_image_data_find(Image_Entry *ie) | |||
3097 | continue; | 3100 | continue; |
3098 | } | 3101 | } |
3099 | 3102 | ||
3103 | if (fd->changed || !fd->valid) continue; | ||
3100 | key = _shared_string_safe_get(fd->key); | 3104 | key = _shared_string_safe_get(fd->key); |
3101 | file = _shared_string_safe_get(fd->path); | 3105 | file = _shared_string_safe_get(fd->path); |
3102 | if (!file) | 3106 | if (!file) |