summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-10-10 09:26:42 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-10-28 15:47:16 +0900
commitc8e6f9e5f9d20d67b49a0355b1b42b1ba8689291 (patch)
tree1040a3df18f7b8a893745516d0c6cadf43a06f10 /src/bin
parent660ad6e4a414c42364ab555f6f77354a97d04610 (diff)
evas/cserve2: Fix font reloading after cserve2 restart.
Well it LOOKS like it's working properly. Clients can safely keep running after cserve2 crashed and restarted.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/evas/evas_cserve2_cache.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/bin/evas/evas_cserve2_cache.c b/src/bin/evas/evas_cserve2_cache.c
index 5ec597bc49..dc2939b5bf 100644
--- a/src/bin/evas/evas_cserve2_cache.c
+++ b/src/bin/evas/evas_cserve2_cache.c
@@ -1865,17 +1865,20 @@ _glyphs_loaded_msg_create(Glyphs_Request *req, int *resp_size)
1865{ 1865{
1866 Msg_Font_Glyphs_Loaded *msg; 1866 Msg_Font_Glyphs_Loaded *msg;
1867 unsigned int size; 1867 unsigned int size;
1868 const char *shmname; 1868 const char *shmname, *idxname;
1869 unsigned int shmname_size; 1869 unsigned int shmname_size, idxname_size;
1870 unsigned int k; 1870 unsigned int k;
1871 char *response, *buf; 1871 char *response, *buf;
1872 1872
1873 shmname = cserve2_shared_mempool_name_get(req->fe->mempool); 1873 shmname = cserve2_shared_mempool_name_get(req->fe->mempool);
1874 shmname_size = strlen(shmname) + 1; 1874 shmname_size = strlen(shmname) + 1;
1875 1875
1876 idxname = cserve2_shared_array_name_get(req->fe->glyph_datas);
1877 idxname_size = strlen(idxname) + 1;
1878
1876 size = sizeof(Msg_Font_Glyphs_Loaded); 1879 size = sizeof(Msg_Font_Glyphs_Loaded);
1877 size += sizeof(int) * 2; 1880 size += sizeof(int) * 3;
1878 size += shmname_size; 1881 size += shmname_size + idxname_size;
1879 size += req->nanswer * 10 * sizeof(int); 1882 size += req->nanswer * 10 * sizeof(int);
1880 1883
1881 response = malloc(size); 1884 response = malloc(size);
@@ -1888,6 +1891,10 @@ _glyphs_loaded_msg_create(Glyphs_Request *req, int *resp_size)
1888 buf += sizeof(int); 1891 buf += sizeof(int);
1889 memcpy(buf, shmname, shmname_size); 1892 memcpy(buf, shmname, shmname_size);
1890 buf += shmname_size; 1893 buf += shmname_size;
1894 memcpy(buf, &idxname_size, sizeof(int));
1895 buf += sizeof(int);
1896 memcpy(buf, idxname, idxname_size);
1897 buf += idxname_size;
1891 memcpy(buf, &req->nanswer, sizeof(int)); 1898 memcpy(buf, &req->nanswer, sizeof(int));
1892 buf += sizeof(int); 1899 buf += sizeof(int);
1893 1900
@@ -2123,15 +2130,7 @@ _glyphs_load_request_response(Glyphs_Request *req,
2123 2130
2124 DBG("Font memory usage [begin]: %d / %d", font_mem_usage, max_font_usage); 2131 DBG("Font memory usage [begin]: %d / %d", font_mem_usage, max_font_usage);
2125 2132
2126 if (!mempool) 2133 cserve2_shared_mempool_generation_id_set(mempool, _generation_id);
2127 {
2128 mempool = cserve2_shared_mempool_new(GLYPH_DATA_ARRAY_TAG,
2129 _generation_id, 0);
2130 font_mem_usage += cserve2_shared_mempool_size_get(mempool);
2131 }
2132 else
2133 cserve2_shared_mempool_generation_id_set(mempool, _generation_id);
2134
2135 if (!fe->glyph_datas) 2134 if (!fe->glyph_datas)
2136 { 2135 {
2137 fe->glyph_datas = cserve2_shared_array_new(GLYPH_INDEX_ARRAY_TAG, 2136 fe->glyph_datas = cserve2_shared_array_new(GLYPH_INDEX_ARRAY_TAG,