summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-08-23 15:10:03 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-10-28 15:47:14 +0900
commit9d2400af8bfedbd74954d185ef1c24190798bb8e (patch)
tree799fcdf9ddebe373cd316cc06872ba2cff4e7fb0 /src/bin
parenta14e69e5733457f2b8e09caadb24271522cbe82b (diff)
evas/cserve2: Add valid flag on Image_Data and File_Data
Images and Files can be discovered by the client scanner before they are valid (aka. loaded or opened). We want clients to ignore all shared objects that are not ready yet, as they are in an undefined state (values and memory might be invalid).
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/evas/evas_cserve2_cache.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bin/evas/evas_cserve2_cache.c b/src/bin/evas/evas_cserve2_cache.c
index a1cda8c78c..88cd2c9669 100644
--- a/src/bin/evas/evas_cserve2_cache.c
+++ b/src/bin/evas/evas_cserve2_cache.c
@@ -618,6 +618,7 @@ _open_request_response(Entry *entry, Slave_Msg_Image_Opened *resp, int *size)
618 fd->loader_data = cserve2_shared_string_add(ldata); 618 fd->loader_data = cserve2_shared_string_add(ldata);
619 } 619 }
620 620
621 fd->valid = EINA_TRUE;
621 return _image_opened_msg_create(fd, size); 622 return _image_opened_msg_create(fd, size);
622} 623}
623 624
@@ -831,6 +832,7 @@ _load_request_response(Image_Entry *ientry,
831 idata = _image_data_find(ENTRYID(ientry)); 832 idata = _image_data_find(ENTRYID(ientry));
832 if (!idata) return NULL; 833 if (!idata) return NULL;
833 834
835 idata->valid = EINA_TRUE;
834 _entry_load_finish(ASENTRY(ientry)); 836 _entry_load_finish(ASENTRY(ientry));
835 ASENTRY(ientry)->request = NULL; 837 ASENTRY(ientry)->request = NULL;
836 838
@@ -1529,6 +1531,7 @@ _image_entry_new(Client *client, int rid,
1529 idata->opts.degree = opts->degree; 1531 idata->opts.degree = opts->degree;
1530 idata->opts.orientation = opts->orientation; 1532 idata->opts.orientation = opts->orientation;
1531 } 1533 }
1534 idata->valid = EINA_FALSE;
1532 idata->file_id = ref->entry->id; 1535 idata->file_id = ref->entry->id;
1533 idata->refcount = 1; 1536 idata->refcount = 1;
1534 idata->id = image_id; 1537 idata->id = image_id;
@@ -2463,10 +2466,11 @@ cserve2_cache_file_open(Client *client, unsigned int client_file_id,
2463 ERR("Could not create new file entry!"); 2466 ERR("Could not create new file entry!");
2464 return -1; 2467 return -1;
2465 } 2468 }
2466 fd->id = file_id; // FIXME: write last (?) 2469 fd->valid = EINA_FALSE;
2467 fd->refcount = 1; 2470 fd->refcount = 1;
2468 fd->path = cserve2_shared_string_add(path); 2471 fd->path = cserve2_shared_string_add(path);
2469 fd->key = cserve2_shared_string_add(key); 2472 fd->key = cserve2_shared_string_add(key);
2473 fd->id = file_id;
2470 2474
2471 fentry = calloc(1, sizeof(File_Entry)); 2475 fentry = calloc(1, sizeof(File_Entry));
2472 ASENTRY(fentry)->type = CSERVE2_IMAGE_FILE; 2476 ASENTRY(fentry)->type = CSERVE2_IMAGE_FILE;