jpeg pushed a commit to branch master.

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

commit 320a9f18c55e3e281b374eb757e22a065d911c09
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Mar 18 12:11:35 2014 +0900

    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
---
 src/bin/evas/evas_cserve2_cache.c      | 1 +
 src/lib/evas/cserve2/evas_cs2_client.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/bin/evas/evas_cserve2_cache.c 
b/src/bin/evas/evas_cserve2_cache.c
index 0c2a5be..7acf201 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
         if (fd)
           {
              fd->changed = EINA_TRUE;
+             fd->valid = EINA_FALSE;
              _file_id_free(fd);
              eina_hash_set(file_entries, &fd->id, NULL);
           }
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c 
b/src/lib/evas/cserve2/evas_cs2_client.c
index 2476e91..d532644 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)
    if (fe->server_file_id)
      {
         if ((fdata = _shared_file_data_get_by_id(fe->server_file_id)) != NULL)
-          return fdata;
+          if (!fdata->changed)
+            return fdata;
+        fe->server_file_id = 0;
      }
 
    // Check hash
@@ -2757,6 +2759,7 @@ _shared_image_entry_file_data_find(Image_Entry *ie)
         fd = &(_index.files.entries.filedata[k]);
         if (!fd->id) break;
         if (!fd->refcount) continue;
+        if (fd->changed) continue;
 
         key = _shared_string_safe_get(fd->key);
         file = _shared_string_safe_get(fd->path);
@@ -3097,6 +3100,7 @@ _shared_image_entry_image_data_find(Image_Entry *ie)
                   continue;
                }
 
+             if (fd->changed || !fd->valid) continue;
              key = _shared_string_safe_get(fd->key);
              file = _shared_string_safe_get(fd->path);
              if (!file)

-- 


Reply via email to