fd->loader_data = cserve2_shared_string_add(ldata);
}
+ fd->valid = EINA_TRUE;
return _image_opened_msg_create(fd, size);
}
idata = _image_data_find(ENTRYID(ientry));
if (!idata) return NULL;
+ idata->valid = EINA_TRUE;
_entry_load_finish(ASENTRY(ientry));
ASENTRY(ientry)->request = NULL;
idata->opts.degree = opts->degree;
idata->opts.orientation = opts->orientation;
}
+ idata->valid = EINA_FALSE;
idata->file_id = ref->entry->id;
idata->refcount = 1;
idata->id = image_id;
ERR("Could not create new file entry!");
return -1;
}
- fd->id = file_id; // FIXME: write last (?)
+ fd->valid = EINA_FALSE;
fd->refcount = 1;
fd->path = cserve2_shared_string_add(path);
fd->key = cserve2_shared_string_add(key);
+ fd->id = file_id;
fentry = calloc(1, sizeof(File_Entry));
ASENTRY(fentry)->type = CSERVE2_IMAGE_FILE;
* -- jpeg
*/
//DBG("Received OPENED for RID: %d [open_rid: %d]", answer->rid, ie->open_rid);
+
+ if (ie->server_id && !ie->open_rid)
+ return;
+
if (answer->rid != ie->open_rid)
{
WRN("Message rid (%d) differs from expected rid (open_rid: %d)", answer->rid, ie->open_rid);
Image_Entry *ie = data;
//DBG("Received LOADED for RID: %d [load_rid: %d]", answer->rid, ie->load_rid);
+
+ if (!ie->load_rid)
+ return;
+
if (answer->rid != ie->load_rid)
{
WRN("Message rid (%d) differs from expected rid (load_rid: %d)", answer->rid, ie->load_rid);
#if USE_SHARED_INDEX
fd = _shared_image_entry_file_data_find(ie);
- if (fd)
+ if (fd && fd->valid)
{
INF("Bypassing socket wait (open_rid %d)", ie->open_rid);
ie->w = fd->w;
ie->animated.loop_hint = fd->loop_hint;
ie->animated.loop_count = fd->loop_count;
ie->animated.frame_count = fd->frame_count;
+ ie->server_id = fd->id;
ie->open_rid = 0;
return CSERVE2_NONE;
}
#if USE_SHARED_INDEX
idata = _shared_image_entry_image_data_find(ie);
- if (idata)
+ if (idata && idata->valid)
{
// FIXME: Ugly copy & paste from _loaded_handle
Data_Entry *dentry = ie->data2;
eina_hash_find(_index.images.entries_by_hkey, ie->cache_key);
if (idata)
{
- ERR("Image found in shared index (by cache_key).");
+ DBG("Image found in shared index (by cache_key).");
goto found;
}
return NULL;
found:
+ if (!idata->valid)
+ {
+ DBG("Found image but it is not ready yet: %d", idata->id);
+ return NULL;
+ }
+
shmpath = _shared_string_get(idata->shm_id);
if (!shmpath)
{