summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2017-05-22 10:27:47 (GMT)
committerMinje Ahn <minje.ahn@samsung.com>2017-05-22 10:31:20 (GMT)
commit34ed08a8f899bffe2f9b27b4bd2e6e180650e61c (patch)
tree0666a10475afbece31105dfb3ef7d0fb3437e4eb /server
parentbddb7b6537d4d96c29c3343ce454a1b1462c07a4 (diff)
downloadlibmedia-thumbnail-34ed08a8f899bffe2f9b27b4bd2e6e180650e61c.zip
libmedia-thumbnail-34ed08a8f899bffe2f9b27b4bd2e6e180650e61c.tar.gz
libmedia-thumbnail-34ed08a8f899bffe2f9b27b4bd2e6e180650e61c.tar.bz2
Remove socket path and structure Change-Id: I5ced06aa5e575d37d79017e8854d1eb9d8415325 Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'server')
-rwxr-xr-xserver/thumb-server-internal.c22
-rwxr-xr-xserver/thumb-server.c14
2 files changed, 5 insertions, 31 deletions
diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c
index 35e87ba..dc921d6 100755
--- a/server/thumb-server-internal.c
+++ b/server/thumb-server-internal.c
@@ -205,19 +205,16 @@ gboolean _thumb_server_read_socket(GIOChannel *src,
static gboolean __thumb_server_send_msg_to_agent(int msg_type)
{
int sock;
- ms_sock_info_s sock_info;
struct sockaddr_un serv_addr;
ms_thumb_server_msg send_msg;
- sock_info.port = MS_THUMB_COMM_PORT;
- if (ms_ipc_create_client_socket(MS_TIMEOUT_SEC_10, &sock_info) < 0) {
+ if (ms_ipc_create_client_socket(MS_TIMEOUT_SEC_10, &sock) < 0) {
thumb_err("ms_ipc_create_server_socket failed");
return FALSE;
}
memset(&serv_addr, 0, sizeof(serv_addr));
- sock = sock_info.sock_fd;
serv_addr.sun_family = AF_UNIX;
SAFE_STRLCPY(serv_addr.sun_path, THUMB_COMM_SOCK_PATH, sizeof(serv_addr.sun_path));
@@ -225,7 +222,7 @@ static gboolean __thumb_server_send_msg_to_agent(int msg_type)
/* Connecting to the thumbnail server */
if (connect(sock, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) {
thumb_stderror("connect");
- ms_ipc_delete_client_socket(&sock_info);
+ close(sock);
return MS_MEDIA_ERR_SOCKET_CONN;
}
@@ -233,13 +230,12 @@ static gboolean __thumb_server_send_msg_to_agent(int msg_type)
if (send(sock, &send_msg, sizeof(ms_thumb_server_msg), 0) != sizeof(ms_thumb_server_msg)) {
thumb_stderror("sendto failed");
- ms_ipc_delete_client_socket(&sock_info);
+ close(sock);
return FALSE;
}
thumb_dbg("Sending msg to thumbnail agent[%d] is successful", send_msg.msg_type);
-
- ms_ipc_delete_client_socket(&sock_info);
+ close(sock);
return TRUE;
}
@@ -263,16 +259,8 @@ static gboolean _thumb_server_send_deny_message(int sockfd)
gboolean _thumb_server_prepare_socket(int *sock_fd)
{
int sock;
- unsigned short serv_port;
-
- thumbMsg recv_msg;
- thumbMsg res_msg;
-
- memset((void *)&recv_msg, 0, sizeof(recv_msg));
- memset((void *)&res_msg, 0, sizeof(res_msg));
- serv_port = MS_THUMB_DAEMON_PORT;
- if (ms_ipc_create_server_socket(serv_port, &sock) < 0) {
+ if (ms_ipc_create_server_socket(MS_THUMB_DAEMON_PORT, &sock) < 0) {
thumb_err("ms_ipc_create_server_socket failed");
return FALSE;
}
diff --git a/server/thumb-server.c b/server/thumb-server.c
index 2c2a02d..7de7eda 100755
--- a/server/thumb-server.c
+++ b/server/thumb-server.c
@@ -34,20 +34,6 @@
extern GMainLoop *g_thumb_server_mainloop;
-#if 0
-static void _media_thumb_signal_handler(void *user_data)
-{
- thumb_dbg("Singal Hander for HEYNOTI \"power_off_start\"");
-
- if (g_thumb_server_mainloop)
- g_main_loop_quit(g_thumb_server_mainloop);
- else
- exit(1);
-
- return;
-}
-#endif
-
int main(void)
{
int sockfd = -1;