summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2018-02-07 14:46:11 +0900
committerMinje ahn <minje.ahn@samsung.com>2018-02-08 07:32:45 +0000
commitb3ceefb00b997a50a3da4288b6af3a56f89385c3 (patch)
tree39b59c3a99d539b3777f3c96f3a14bcf9ca0070f /server
parente5525329e1e7006393e9c0972f881f218993a29a (diff)
downloadlibmedia-thumbnail-b3ceefb00b997a50a3da4288b6af3a56f89385c3.tar.gz
libmedia-thumbnail-b3ceefb00b997a50a3da4288b6af3a56f89385c3.tar.bz2
libmedia-thumbnail-b3ceefb00b997a50a3da4288b6af3a56f89385c3.zip
[SATIZENVUL-1315/SATIZENVUL-1316] Remove msg size from thumbMsg
Change-Id: Iaae0d5707294314a1bf856857521f95fb8582691 Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'server')
-rwxr-xr-xserver/thumb-server-internal.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c
index 2f85b30..9116c05 100755
--- a/server/thumb-server-internal.c
+++ b/server/thumb-server-internal.c
@@ -126,33 +126,29 @@ gboolean _thumb_server_read_socket(GIOChannel *src, GIOCondition condition, gpoi
res_msg.msg_type = recv_msg.msg_type;
res_msg.request_id = recv_msg.request_id;
SAFE_STRLCPY(res_msg.org_path, recv_msg.org_path, sizeof(res_msg.org_path));
- res_msg.origin_path_size = recv_msg.origin_path_size;
- if (res_msg.msg_type != THUMB_RESPONSE_RAW_DATA) {
- res_msg.dest_path_size = strlen(res_msg.dst_path)+1;
+ if (res_msg.msg_type != THUMB_RESPONSE_RAW_DATA)
res_msg.thumb_size = 0;
- } else {
- res_msg.dest_path_size = 1;
+ else
res_msg.dst_path[0] = '\0';
- }
int buf_size = 0;
int sending_block = 0;
- int block_size = sizeof(res_msg) - MAX_FILEPATH_LEN * 2 - sizeof(unsigned char *);
+ int block_size = sizeof(res_msg) - sizeof(unsigned char *);
unsigned char *buf = NULL;
_media_thumb_set_buffer(&res_msg, &buf, &buf_size);
while (buf_size > 0) {
- if (buf_size < THUMB_BLOCK_SIZE) {
+ if (buf_size < THUMB_BLOCK_SIZE)
block_size = buf_size;
- }
+
if (send(client_sock, buf+sending_block, block_size, 0) != block_size) {
thumb_stderror("sendto failed");
+ break;
}
sending_block += block_size;
buf_size -= block_size;
- if (block_size < THUMB_BLOCK_SIZE) {
+ if (block_size < THUMB_BLOCK_SIZE)
block_size = THUMB_BLOCK_SIZE;
- }
}
thumb_dbg_slog("Sent data(%d) from %s", res_msg.thumb_size, res_msg.org_path);
@@ -210,7 +206,7 @@ static gboolean __thumb_server_send_msg_to_agent(int msg_type)
static gboolean _thumb_server_send_deny_message(int sockfd)
{
thumbMsg msg = {0};
- int bytes_to_send = sizeof(msg) - sizeof(msg.org_path) - sizeof(msg.dst_path);
+ int bytes_to_send = sizeof(msg);
msg.msg_type = THUMB_RESPONSE;
msg.status = MS_MEDIA_ERR_PERMISSION_DENIED;