evas/cserve2: pass loader data during open.
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 26 Jun 2013 06:11:06 +0000 (15:11 +0900)
committerCedric Bail <cedric.bail@samsung.com>
Tue, 2 Jul 2013 07:58:10 +0000 (16:58 +0900)
Note: this path seems never to be used.
Loader options are set by the file loader or after open.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
src/bin/evas/evas_cserve2_cache.c

index bbb6ce2..8090da2 100644 (file)
@@ -334,13 +334,16 @@ static void *
 _open_request_build(File_Data *f, int *bufsize)
 {
    char *buf;
-   int size, pathlen, keylen;
+   int size, pathlen, keylen, loaderlen;
    Slave_Msg_Image_Open msg;
 
    pathlen = strlen(f->path) + 1;
    keylen = strlen(f->key) + 1;
 
-   size = sizeof(msg) + pathlen + keylen;
+   msg.has_loader_data = !!f->loader_data;
+   loaderlen = msg.has_loader_data ? (strlen(f->loader_data) + 1) : 0;
+
+   size = sizeof(msg) + pathlen + keylen + loaderlen;
    buf = malloc(size);
    if (!buf) return NULL;
 
@@ -348,6 +351,8 @@ _open_request_build(File_Data *f, int *bufsize)
    memcpy(buf, &msg, sizeof(msg));
    memcpy(buf + sizeof(msg), f->path, pathlen);
    memcpy(buf + sizeof(msg) + pathlen, f->key, keylen);
+   if (msg.has_loader_data)
+     memcpy(buf + sizeof(msg) + pathlen + keylen, f->loader_data, loaderlen);
 
    *bufsize = size;