summaryrefslogtreecommitdiff
path: root/src/lib/evas/cserve2/evas_cs2_client.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-01-13 17:42:14 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-01-14 14:23:05 +0900
commit06b53dd09b459a7e6f0d7721d7afa007b47a5591 (patch)
tree07ab2ea540089d0d27b3cf0b60055d28de63471b /src/lib/evas/cserve2/evas_cs2_client.c
parent99efaf4ad17013fae3b10c02ffa8de9d6c767e5d (diff)
Evas/cserve2: Keep image_id when reopening a changed file
If a file had changed, a new OPEN message was sent, and the client image ID was then changed, but the LOAD message was sent with the previous image ID. So cserve2 would not be able to honor that request.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/cserve2/evas_cs2_client.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c
index de1ce38e6d..9898e5ca6e 100644
--- a/src/lib/evas/cserve2/evas_cs2_client.c
+++ b/src/lib/evas/cserve2/evas_cs2_client.c
@@ -1057,9 +1057,6 @@ _image_open_server_send(Image_Entry *ie)
1057 has_load_opts = EINA_TRUE; 1057 has_load_opts = EINA_TRUE;
1058 } 1058 }
1059 1059
1060 ie->data1 = NULL;
1061 ie->data2 = NULL;
1062
1063 file = ie->file; 1060 file = ie->file;
1064 key = ie->key; 1061 key = ie->key;
1065 1062
@@ -1092,13 +1089,18 @@ _image_open_server_send(Image_Entry *ie)
1092 else 1089 else
1093 EINA_REFCOUNT_REF(fentry); 1090 EINA_REFCOUNT_REF(fentry);
1094 1091
1095 dentry = calloc(1, sizeof(*dentry)); 1092 if (!ie->data2)
1096 if (!dentry)
1097 { 1093 {
1098 EINA_REFCOUNT_UNREF(fentry) 1094 dentry = calloc(1, sizeof(*dentry));
1099 eina_hash_del(_file_entries, fentry->hkey, fentry); 1095 if (!dentry)
1100 return 0; 1096 {
1097 EINA_REFCOUNT_UNREF(fentry)
1098 eina_hash_del(_file_entries, fentry->hkey, fentry);
1099 return 0;
1100 }
1101 dentry->image_id = ++_data_id;
1101 } 1102 }
1103 else dentry = ie->data2;
1102 1104
1103 memset(&msg_open, 0, sizeof(msg_open)); 1105 memset(&msg_open, 0, sizeof(msg_open));
1104 msg_open.base.rid = _next_rid(); 1106 msg_open.base.rid = _next_rid();
@@ -1107,7 +1109,7 @@ _image_open_server_send(Image_Entry *ie)
1107 msg_open.path_offset = 0; 1109 msg_open.path_offset = 0;
1108 msg_open.key_offset = flen; 1110 msg_open.key_offset = flen;
1109 msg_open.has_load_opts = has_load_opts; 1111 msg_open.has_load_opts = has_load_opts;
1110 msg_open.image_id = ++_data_id; 1112 msg_open.image_id = dentry->image_id;
1111 1113
1112 size = sizeof(msg_open) + flen + klen; 1114 size = sizeof(msg_open) + flen + klen;
1113 if (has_load_opts) 1115 if (has_load_opts)
@@ -1118,6 +1120,7 @@ _image_open_server_send(Image_Entry *ie)
1118 EINA_REFCOUNT_UNREF(fentry) 1120 EINA_REFCOUNT_UNREF(fentry)
1119 eina_hash_del(_file_entries, fentry->hkey, fentry); 1121 eina_hash_del(_file_entries, fentry->hkey, fentry);
1120 free(dentry); 1122 free(dentry);
1123 ie->data2 = NULL;
1121 return 0; 1124 return 0;
1122 } 1125 }
1123 memcpy(buf, &msg_open, sizeof(msg_open)); 1126 memcpy(buf, &msg_open, sizeof(msg_open));
@@ -1129,9 +1132,10 @@ _image_open_server_send(Image_Entry *ie)
1129 if (!_server_send(buf, size, _image_opened_cb, ie)) 1132 if (!_server_send(buf, size, _image_opened_cb, ie))
1130 { 1133 {
1131 ERR("Couldn't send message to server."); 1134 ERR("Couldn't send message to server.");
1132 free(dentry);
1133 EINA_REFCOUNT_UNREF(fentry) 1135 EINA_REFCOUNT_UNREF(fentry)
1134 eina_hash_del(_file_entries, fentry->hkey, fentry); 1136 eina_hash_del(_file_entries, fentry->hkey, fentry);
1137 free(dentry);
1138 ie->data2 = NULL;
1135 return 0; 1139 return 0;
1136 } 1140 }
1137 1141