Add request id for nlp service 05/187605/1
authorzhangzg <zg84.zhang@samsung.com>
Sat, 25 Aug 2018 06:45:16 +0000 (14:45 +0800)
committerzhangzg <zg84.zhang@samsung.com>
Sat, 25 Aug 2018 06:45:16 +0000 (14:45 +0800)
Change-Id: Id344dd0a79ecbfa38750ce25d3b99dbebc00e539

service/src/service.c

index 11fb89f..7d069f6 100644 (file)
@@ -111,6 +111,7 @@ static int __message_send(rpc_port_stub_message_context_h context,
 
     bundle *reply = bundle_create();
     char *info = NULL;
+    char *request_id = NULL;
     PyObject* args = NULL;
     PyObject* lists = NULL;
     unsigned static int len = 0;
@@ -126,6 +127,7 @@ static int __message_send(rpc_port_stub_message_context_h context,
     PyObject* ld_module = NULL;
     PyObject* ld_result = NULL;
     PyObject* pos_elm_tuple = NULL;
+    bundle_get_str(msg, "request_id", &request_id);
     bundle_get_str(msg, "info", &info);
     NLTK_CMDS cmd = NLTK_CMD_NONE;
     if (message)
@@ -245,6 +247,7 @@ static int __message_send(rpc_port_stub_message_context_h context,
             bundle_add_str(reply, "command", "Exception happens");
             break;
     }
+    bundle_add_str(reply, "request_id", request_id);
     rpc_port_message_notify_cb_invoke(sender_client->cb, sender_client->id, reply);
     bundle_free(reply);
     return 0;