summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>2014-11-03 10:19:07 (GMT)
committerJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>2014-12-05 13:09:35 (GMT)
commit0e0374b7ed2cd696418ba1c946afeaaa991e29f8 (patch)
tree45dcd675920e649ab2fe077fb9395b20bfad6361 /server
parentf0be21988c9b0a4d165d386f8062a4bf2f5b095b (diff)
downloadlibmedia-thumbnail-0e0374b7ed2cd696418ba1c946afeaaa991e29f8.zip
libmedia-thumbnail-0e0374b7ed2cd696418ba1c946afeaaa991e29f8.tar.gz
libmedia-thumbnail-0e0374b7ed2cd696418ba1c946afeaaa991e29f8.tar.bz2
Use connected socket to communicate with CAPIrefs/changes/29/31529/1
Add credential option to get user UID from CAPI Bug-Tizen: TC-1598 Change-Id: Ib9bf7164a82766b29c2e13868e63d6bca64ea3c4 Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Diffstat (limited to 'server')
-rwxr-xr-xserver/thumb-server-internal.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c
index 6de74ad..860bc6a 100755
--- a/server/thumb-server-internal.c
+++ b/server/thumb-server-internal.c
@@ -421,7 +421,7 @@ gboolean _thumb_server_send_msg_to_agent(int msg_type)
ms_thumb_server_msg send_msg;
#ifdef _USE_UDS_SOCKET_
- if (ms_ipc_create_client_socket(MS_PROTOCOL_UDP, MS_TIMEOUT_SEC_10, &sock, MS_THUMB_COMM_PORT) < 0) {
+ if (ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock, MS_THUMB_COMM_PORT) < 0) {
#else
if (ms_ipc_create_client_socket(MS_PROTOCOL_UDP, MS_TIMEOUT_SEC_10, &sock) < 0) {
#endif
@@ -441,7 +441,14 @@ gboolean _thumb_server_send_msg_to_agent(int msg_type)
send_msg.msg_type = msg_type;
- if (sendto(sock, &send_msg, sizeof(ms_thumb_server_msg), 0, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != sizeof(ms_thumb_server_msg)) {
+
+ if (connect(sock, &serv_addr, sizeof(serv_addr)) < 0) {
+ thumb_err("connect failed [%s]",strerror(errno));
+ close(sock);
+ return FALSE;
+ }
+
+ if (send(sock, &send_msg, sizeof(ms_thumb_server_msg), 0) != sizeof(ms_thumb_server_msg)) {
thumb_err("sendto failed: %s\n", strerror(errno));
close(sock);
return FALSE;