install-data-hook:
mkdir $(DESTDIR)$(nor_directory) -p
- ln -s ../init.d/mediasvr S99mediasvr
- mv ./S99mediasvr $(DESTDIR)$(nor_directory)
+ ln -s ../init.d/mediasvr S46mediasvr
+ mv ./S46mediasvr $(DESTDIR)$(nor_directory)
mkdir $(DESTDIR)$(hib_directory) -p
- ln -s ../init.d/mediasvr S99mediasvr
- mv ./S99mediasvr $(DESTDIR)$(hib_directory)
+ ln -s ../init.d/mediasvr S46mediasvr
+ mv ./S46mediasvr $(DESTDIR)$(hib_directory)
# init.d script
fmsvcdir = /etc/rc.d/init.d
int ms_ipc_create_server_socket(ms_protocol_e protocol, int port, int *sock_fd)
{
+ int i;
+ bool bind_success = false;
int sock = -1;
int n_reuse = 1;
#ifdef _USE_UDS_SOCKET_
serv_addr.sin_addr.s_addr = inet_addr(SERVER_IP);
serv_addr.sin_port = htons(serv_port);
#endif
-
/* Bind to the local address */
- if (bind(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
- MSAPI_DBG_ERR("bind failed : %s", strerror(errno));
+ for (i = 0; i < 20; i ++) {
+ if (bind(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) == 0) {
+ bind_success = true;
+ break;
+ }
+ MSAPI_DBG("%d",i);
+ usleep(250000);
+ }
+
+ if (bind_success == false) {
+ MSAPI_DBG_ERR("bind failed : %s %d_", strerror(errno), errno);
close(sock);
return MS_MEDIA_ERR_SOCKET_CONN;
}
/* A Ping signal on the com.burtonini.dbus.Signal interface */
if (dbus_message_is_signal (message, MS_MEDIA_DBUS_INTERFACE, MS_MEDIA_DBUS_NAME)) {
int i = 0;
+ int current_type = DBUS_TYPE_INVALID;
DBusError error;
DBusMessageIter read_iter;
- DBusBasicValue value[7];
+ DBusBasicValue value[6];
dbus_int32_t item = -1;
dbus_int32_t pid = 0;
char *update_path = NULL;
char *uuid = NULL;
char *mime_type = NULL;
+ void *recevie_path = NULL;
+ int path_len = 0;
dbus_error_init (&error);
MSAPI_DBG("size [%d]", sizeof(value));
/* get data from dbus message */
dbus_message_iter_init (message, &read_iter);
- while (dbus_message_iter_get_arg_type (&read_iter) != DBUS_TYPE_INVALID){
- dbus_message_iter_get_basic (&read_iter, &value[i]);
+ while ((current_type = dbus_message_iter_get_arg_type (&read_iter)) != DBUS_TYPE_INVALID){
+ if (current_type == DBUS_TYPE_ARRAY) {
+ DBusMessageIter sub;
+ dbus_message_iter_recurse(&read_iter, &sub);
+ dbus_message_iter_get_fixed_array(&sub, &recevie_path, &path_len);
+ } else {
+ dbus_message_iter_get_basic (&read_iter, &value[i]);
+ i ++;
+ }
dbus_message_iter_next (&read_iter);
- i ++;
}
item = value[0].i32;
pid = value[1].i32;
update_type = value[2].i32;
- update_path = strdup(value[3].str);
- if (value[4].str != NULL) uuid = strdup(value[4].str);
- content_type = value[5].i32;
- if (value[6].str != NULL) mime_type = strdup(value[6].str);
+ update_path = strndup(recevie_path, path_len);
+ if (value[3].str != NULL) uuid = strdup(value[3].str);
+ content_type = value[4].i32;
+ if (value[5].str != NULL) mime_type = strdup(value[5].str);
+
+ if (item == MS_MEDIA_ITEM_DIRECTORY)
+ content_type = MS_MEDIA_UNKNOWN;
/* getting data complete */
user_cb(pid,
mime_type,
userdata);
+ MS_SAFE_FREE(update_path);
+ MS_SAFE_FREE(uuid);
+ MS_SAFE_FREE(mime_type);
+
g_mutex_unlock(noti_mutex);
return DBUS_HANDLER_RESULT_HANDLED;
if (noti_mutex == NULL) {
noti_mutex = g_mutex_new();
+ if (noti_mutex == NULL) {
+ return MS_MEDIA_ERR_ALLOCATE_MEMORY_FAIL;
+ }
}
if (g_bus == NULL) {
if (!g_bus) {
MSAPI_DBG ("Failed to connect to the D-BUS daemon: %s", error.message);
dbus_error_free (&error);
+ g_mutex_free(noti_mutex);
+ noti_mutex = NULL;
return MS_MEDIA_ERR_DBUS_GET;
}
MS_MALLOC(callback_data, sizeof(noti_callback_data));
if (callback_data == NULL) {
MSAPI_DBG_ERR("MS_MALLOC failed");
+ g_mutex_free(noti_mutex);
+ noti_mutex = NULL;
return MS_MEDIA_ERR_ALLOCATE_MEMORY_FAIL;
}
callback_data->user_callback = user_cb;
dbus_bus_add_match (g_bus, MS_MEDIA_DBUS_MATCH_RULE, &error);
if( !dbus_connection_add_filter (g_bus, __message_filter, callback_data, __free_data_fuction)) {
MS_SAFE_FREE(callback_data);
+ g_mutex_free(noti_mutex);
+ noti_mutex = NULL;
return MS_MEDIA_ERR_DBUS_ADD_FILTER;
}
g_data_store = (void *)callback_data;
int media_db_update_unsubscribe(void)
{
- g_mutex_lock(noti_mutex);
+ if (g_bus == NULL) {
+ return MS_MEDIA_ERR_NONE;
+ }
- if (g_bus != NULL) {
- dbus_connection_remove_filter(g_bus, __message_filter, g_data_store);
+ g_mutex_lock(noti_mutex);
- dbus_connection_unref(g_bus);
+ dbus_connection_remove_filter(g_bus, __message_filter, g_data_store);
+ dbus_connection_unref(g_bus);
- g_bus = NULL;
- }
+ g_bus = NULL;
g_mutex_unlock(noti_mutex);
- if (noti_mutex) g_mutex_free(noti_mutex);
+ g_mutex_free(noti_mutex);
noti_mutex = NULL;
return MS_MEDIA_ERR_NONE;
DBusMessage *message;
DBusConnection *bus;
DBusError error;
+ unsigned char *path_array = NULL;
+ int path_length = strlen(path) + 1;
/* Get a connection to the session bus */
dbus_error_init (&error);
return MS_MEDIA_ERR_DBUS_GET;
}
- /* Create a new signal on the "MS_DBUS_INTERFACE" interface,
- * from the object "MS_DBUS_PATH". */
+ path_array = malloc(sizeof(unsigned char) * path_length);
+ memcpy(path_array, path, path_length);
+
message = dbus_message_new_signal (MS_MEDIA_DBUS_PATH, MS_MEDIA_DBUS_INTERFACE, MS_MEDIA_DBUS_NAME);
if (message != NULL) {
if (item == MS_MEDIA_ITEM_FILE) {
DBUS_TYPE_INT32, &item,
DBUS_TYPE_INT32, &pid,
DBUS_TYPE_INT32, &update_type,
- DBUS_TYPE_STRING, &path,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &path_array, path_length,
DBUS_TYPE_STRING, &uuid,
DBUS_TYPE_INT32, &media_type,
DBUS_TYPE_STRING, &mime_type,
DBUS_TYPE_INT32, &item,
DBUS_TYPE_INT32, &pid,
DBUS_TYPE_INT32, &update_type,
- DBUS_TYPE_STRING, &path,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &path_array, path_length,
DBUS_TYPE_STRING, &uuid,
DBUS_TYPE_INVALID);
} else {
DBUS_TYPE_INT32, &item,
DBUS_TYPE_INT32, &pid,
DBUS_TYPE_INT32, &update_type,
- DBUS_TYPE_STRING, &path,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &path_array, path_length,
DBUS_TYPE_INVALID);
}
} else {
MSAPI_DBG("this request is wrong");
}
+ MS_SAFE_FREE(path_array);
+
/* Send the signal */
dbus_connection_send (bus, message, NULL);
Name: media-server
Summary: File manager service server.
-Version: 0.2.34
+Version: 0.2.39
Release: 1
Group: utils
License: Apache License, Version 2.0
%{_bindir}/media-scanner
%{_bindir}/mediadb-update
%attr(755,-,-) %{_sysconfdir}/rc.d/init.d/mediasvr
-/etc/rc.d/rc3.d/S99mediasvr
-/etc/rc.d/rc5.d/S99mediasvr
+/etc/rc.d/rc3.d/S46mediasvr
+/etc/rc.d/rc5.d/S46mediasvr
/usr/lib/systemd/system/media-server.service
/usr/lib/systemd/system/multi-user.target.wants/media-server.service
#License
MS_DBG_ERR("%s [%d]", path, ret);
return MS_MEDIA_ERR_DRM_GET_INFO_FAIL;
} else {
- MS_DBG_ERR("DRM TYPE [%d]", file_type);
/* if a drm file is OMA drm, use DRM API for getting mime information */
if (file_type == DRM_TYPE_OMA_V1
|| file_type == DRM_TYPE_OMA_V2
int
ms_drm_register(const char* path)
{
- MS_DBG("THIS IS DRM FILE");
+
int res = MS_MEDIA_ERR_NONE;
int ret;
#include "media-common-types.h"
-typedef int (*CHECK_ITEM)(const char*, const char*, char **);
+typedef int (*CHECK_ITEM)(const char*, char **);
typedef int (*CONNECT)(void**, char **);
typedef int (*DISCONNECT)(void*, char **);
typedef int (*CHECK_ITEM_EXIST)(void*, const char*, int, char **);
typedef int (*INSERT_ITEM_BEGIN)(void*, int, int, int, char **);
typedef int (*INSERT_ITEM_END)(void*, char **);
-typedef int (*INSERT_ITEM)(void*, const char*, int, const char*, char **);
+typedef int (*INSERT_ITEM)(void*, const char*, int, char **);
typedef int (*SET_ALL_STORAGE_ITEMS_VALIDITY)(void*, int, int, char **);
typedef int (*SET_ITEM_VALIDITY_BEGIN)(void*, int, char **);
typedef int (*SET_ITEM_VALIDITY_END)(void*, char **);
-typedef int (*SET_ITEM_VALIDITY)(void*, const char*, int, const char*, int, char **);
+typedef int (*SET_ITEM_VALIDITY)(void*, const char*, int, int, char **);
typedef int (*DELETE_ALL_ITEMS_IN_STORAGE)(void*, int, char **);
typedef int (*DELETE_ALL_INVALID_ITMES_IN_STORAGE)(void*, int, char **);
typedef int (*UPDATE_BEGIN)(void);
typedef int (*UPDATE_END)(void);
typedef int (*SET_FOLDER_ITEM_VALIDITY)(void*, const char*, int, int, char**);
typedef int (*DELETE_ALL_INVALID_ITEMS_IN_FOLDER)(void*, const char*, char**);
-typedef int (*INSERT_BURST_ITEM)(void *, const char *, int , const char*, char **);
+typedef int (*INSERT_BURST_ITEM)(void *, const char *, int , char **);
typedef int (*SEND_DIR_UPDATE_NOTI)(void *, const char *, char **);
int
};
static int
-_msc_check_category(const char *path, const char *mimetype, int index)
+_msc_check_category(const char *path, int index)
{
int ret;
char *err_msg = NULL;
- ret = ((CHECK_ITEM)func_array[index][eCHECK])(path, mimetype, &err_msg);
+ ret = ((CHECK_ITEM)func_array[index][eCHECK])(path, &err_msg);
if (ret != 0) {
MSC_DBG_ERR("error : %s [%s] %s", g_array_index(so_array, char*, index), err_msg, path);
MS_SAFE_FREE(err_msg);
int res = MS_MEDIA_ERR_NONE;
int ret;
char *err_msg = NULL;
- char mimetype[255] = {0};
ms_storage_type_t storage_type;
- ret = ms_get_mime(path, mimetype);
- if (ret != MS_MEDIA_ERR_NONE) {
- MSC_DBG_ERR("err : ms_get_mime [%d]", ret);
- return ret;
- }
storage_type = ms_get_storage_type_by_full(path);
for (lib_index = 0; lib_index < lib_num; lib_index++) {
- if (!_msc_check_category(path, mimetype, lib_index)) {
+ if (!_msc_check_category(path, lib_index)) {
/*check exist in Media DB, If file is not exist, insert data in DB. */
ret = ((CHECK_ITEM_EXIST)func_array[lib_index][eEXIST])(handle[lib_index], path, storage_type, &err_msg); /*dlopen*/
if (ret != 0) {
MSC_DBG_ERR("not exist in %d. insert data", lib_index);
MS_SAFE_FREE(err_msg);
- ret = ((INSERT_ITEM)func_array[lib_index][eINSERT_BATCH])(handle[lib_index], path, storage_type, mimetype, &err_msg); /*dlopen*/
+ ret = ((INSERT_ITEM)func_array[lib_index][eINSERT_BATCH])(handle[lib_index], path, storage_type, &err_msg); /*dlopen*/
if (ret != 0) {
MSC_DBG_ERR("error : %s [%s] %s", g_array_index(so_array, char*, lib_index), err_msg, path);
- MSC_DBG_ERR("[%s] %s", mimetype, path);
+ MSC_DBG_ERR("[%s]", path);
MS_SAFE_FREE(err_msg);
res = MS_MEDIA_ERR_DB_INSERT_FAIL;
}
} else {
/*if meta data of file exist, change valid field to "1" */
- ret = ((SET_ITEM_VALIDITY)func_array[lib_index][eSET_VALIDITY])(handle[lib_index], path, true, mimetype, true, &err_msg); /*dlopen*/
+ ret = ((SET_ITEM_VALIDITY)func_array[lib_index][eSET_VALIDITY])(handle[lib_index], path, true, true, &err_msg); /*dlopen*/
if (ret != 0) {
MSC_DBG_ERR("error : %s [%s] %s", g_array_index(so_array, char*, lib_index), err_msg, path);
- MSC_DBG_ERR("[%s] %s", mimetype, path);
+ MSC_DBG_ERR("[%s]", path);;
MS_SAFE_FREE(err_msg);
res = MS_MEDIA_ERR_DB_UPDATE_FAIL;
}
}
} else {
MSC_DBG_ERR("check category failed");
- MSC_DBG_ERR("[%s] %s", mimetype, path);
+ MSC_DBG_ERR("[%s]", path);
}
}
int lib_index;
int res = MS_MEDIA_ERR_NONE;
int ret;
- char mimetype[255] = {0};
char *err_msg = NULL;
ms_storage_type_t storage_type;
- ret = ms_get_mime(path, mimetype);
- if (ret != MS_MEDIA_ERR_NONE) {
- MSC_DBG_ERR("err : ms_get_mime [%d]", ret);
- return ret;
- }
-
storage_type = ms_get_storage_type_by_full(path);
for (lib_index = 0; lib_index < lib_num; lib_index++) {
- if (!_msc_check_category(path, mimetype, lib_index)) {
- ret = ((INSERT_ITEM)func_array[lib_index][eINSERT_BATCH])(handle[lib_index], path, storage_type, mimetype, &err_msg); /*dlopen*/
+ if (!_msc_check_category(path, lib_index)) {
+ ret = ((INSERT_ITEM)func_array[lib_index][eINSERT_BATCH])(handle[lib_index], path, storage_type, &err_msg); /*dlopen*/
if (ret != 0) {
MSC_DBG_ERR("error : %s [%s]", g_array_index(so_array, char*, lib_index), err_msg);
- MSC_DBG_ERR("[%s] %s", mimetype, path);
+ MSC_DBG_ERR("[%s]", path);
MS_SAFE_FREE(err_msg);
res = MS_MEDIA_ERR_DB_INSERT_FAIL;
}
} else {
MSC_DBG_ERR("check category failed");
- MSC_DBG_ERR("[%s] %s", mimetype, path);
+ MSC_DBG_ERR("[%s]", path);
}
}
int lib_index;
int res = MS_MEDIA_ERR_NONE;
int ret;
- char mimetype[255] = {0};
char *err_msg = NULL;
ms_storage_type_t storage_type;
- ret = ms_get_mime(path, mimetype);
- if (ret != MS_MEDIA_ERR_NONE) {
- MSC_DBG_ERR("err : ms_get_mime [%d]", ret);
- return ret;
- }
-
storage_type = ms_get_storage_type_by_full(path);
for (lib_index = 0; lib_index < lib_num; lib_index++) {
- if (!_msc_check_category(path, mimetype, lib_index)) {
- ret = ((INSERT_BURST_ITEM)func_array[lib_index][eINSERT_BURST])(handle[lib_index], path, storage_type, mimetype, &err_msg); /*dlopen*/
+ if (!_msc_check_category(path, lib_index)) {
+ ret = ((INSERT_BURST_ITEM)func_array[lib_index][eINSERT_BURST])(handle[lib_index], path, storage_type, &err_msg); /*dlopen*/
if (ret != 0) {
MSC_DBG_ERR("error : %s [%s]", g_array_index(so_array, char*, lib_index), err_msg);
- MSC_DBG_ERR("[%s] %s", mimetype, path);
+ MSC_DBG_ERR("[%s]", path);
MS_SAFE_FREE(err_msg);
res = MS_MEDIA_ERR_DB_INSERT_FAIL;
}
} else {
MSC_DBG_ERR("check category failed");
- MSC_DBG_ERR("[%s] %s", mimetype, path);
+ MSC_DBG_ERR("[%s]", path);
}
}
return ret;
}
-static void _msc_insert_array(GArray *garray, ms_comm_msg_s *insert_data)
-{
- MSC_DBG_INFO("path : %s", insert_data->msg);
- MSC_DBG_INFO("scan_type : %d", insert_data->msg_type);
-
- if (insert_data->pid == POWEROFF) {
- g_array_prepend_val(garray, insert_data);
- } else {
- g_array_append_val(garray, insert_data);
- }
-}
-
void _msc_check_dir_path(char *dir_path)
{
/* need implementation */
gboolean msc_directory_scan_thread(void *data)
{
ms_comm_msg_s *scan_data = NULL;
- ms_comm_msg_s *insert_data = NULL;
- GArray *garray = NULL;
- int length;
int err;
int ret;
void **handle = NULL;
ms_storage_type_t storage_type;
int scan_type;
- /*create array for processing overlay data*/
- garray = g_array_new (FALSE, FALSE, sizeof (ms_comm_msg_s *));
- if (garray == NULL) {
- MSC_DBG_ERR("g_array_new error");
- return false;
- }
-
while (1) {
- length = g_async_queue_length(scan_queue);
-
- /*updating requests remain*/
- if (garray->len != 0 && length == 0) {
- scan_data = g_array_index(garray, ms_comm_msg_s*, 0);
- g_array_remove_index (garray, 0);
- if (scan_data->pid == POWEROFF) {
- MSC_DBG_INFO("power off");
- goto _POWEROFF;
- }
- } else if (length != 0) {
- insert_data = g_async_queue_pop(scan_queue);
- _msc_insert_array(garray, insert_data);
- continue;
- } else if (garray->len == 0 && length == 0) {
- /*Threre is no request, Wait until pushung new request*/
- insert_data = g_async_queue_pop(scan_queue);
- _msc_insert_array(garray, insert_data);
- continue;
+ scan_data = g_async_queue_pop(scan_queue);
+ if (scan_data->pid == POWEROFF) {
+ MSC_DBG_INFO("power off");
+ goto _POWEROFF;
}
MSC_DBG_INFO("DIRECTORY SCAN START");
_POWEROFF:
MS_SAFE_FREE(scan_data);
- if (garray) g_array_free (garray, TRUE);
if (handle) msc_disconnect_db(&handle);
return false;
gboolean msc_storage_scan_thread(void *data)
{
ms_comm_msg_s *scan_data = NULL;
- ms_comm_msg_s *insert_data = NULL;
- GArray *garray = NULL;
bool res;
int ret;
- int length;
int err;
void **handle = NULL;
ms_storage_type_t storage_type;
int scan_type;
- /*create array for processing overlay data*/
- garray = g_array_new (FALSE, FALSE, sizeof (ms_comm_msg_s *));
- if (garray == NULL) {
- MSC_DBG_ERR("g_array_new error");
- return false;
- }
-
while (1) {
- length = g_async_queue_length(storage_queue);
-
- /*updating requests remain*/
- if (garray->len != 0 && length == 0) {
- scan_data = g_array_index(garray, ms_comm_msg_s*, 0);
- g_array_remove_index (garray, 0);
- if (scan_data->pid == POWEROFF) {
- MSC_DBG_INFO("power off");
- goto _POWEROFF;
- }
- } else if (length != 0) {
- insert_data = g_async_queue_pop(storage_queue);
- _msc_insert_array(garray, insert_data);
- continue;
- } else if (garray->len == 0 && length == 0) {
- /*Threre is no request, Wait until pushing new request*/
- insert_data = g_async_queue_pop(storage_queue);
- _msc_insert_array(garray, insert_data);
- continue;
+ scan_data = g_async_queue_pop(storage_queue);
+ if (scan_data->pid == POWEROFF) {
+ MSC_DBG_INFO("power off");
+ goto _POWEROFF;
}
MSC_DBG_INFO("STORAGE SCAN START");
_POWEROFF:
MS_SAFE_FREE(scan_data);
- if (garray) g_array_free (garray, TRUE);
if (handle) msc_disconnect_db(&handle);
return false;
#include <dirent.h>
#include <vconf.h>
#include <heynoti.h>
-#include <errno.h>
#include "media-common-utils.h"
#include "media-common-drm.h"
}
}
} else {
- MSC_DBG_ERR("media-server: Looking for process of name: [%s]. Cannot find. Reason: %s", APP_NAME, strerror(errno));
+ MSC_DBG_ERR("Can't read file [%s]", path);
}
}
g_async_queue_push(reg_queue, GINT_TO_POINTER(reg_data));
}
+ if (storage_queue) {
+ /*notify to register thread*/
+ MS_MALLOC(reg_data, sizeof(ms_comm_msg_s));
+ reg_data->pid = POWEROFF;
+ g_async_queue_push(storage_queue, GINT_TO_POINTER(reg_data));
+ }
+
if (g_main_loop_is_running(scanner_mainloop)) g_main_loop_quit(scanner_mainloop);
}
_msc_mmc_vconf_cb(void *data)
{
int status = 0;
+/*
ms_comm_msg_s *scan_msg;
ms_dir_scan_type_t scan_type = MS_SCAN_PART;
-
+*/
if (!ms_config_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &status)) {
MSC_DBG_ERR("Get VCONFKEY_SYSMAN_MMC_STATUS failed.");
}
}
}
} else {
- MS_DBG_ERR("media-server: Looking for process of name: [%s]. Cannot find. Reason: %s", APP_NAME, strerror(errno));
+ MS_DBG_ERR("Can't read file [%s]", path);
}
}
pid = waitpid(-1, &stat, WNOHANG);
/* check pid of child process of thumbnail thread */
- MS_DBG("[PID %d] signal ID %d", pid, n);
+ MS_DBG_ERR("[PID %d] signal ID %d", pid, n);
if (pid == thumb_pid) {
- MS_DBG("Thumbnail server is dead");
+ MS_DBG_ERR("Thumbnail server is dead");
ms_thumb_reset_server_status();
} else if (pid == scanner_pid) {
- MS_DBG("Scanner is dead");
+ MS_DBG_ERR("Scanner is dead");
ms_reset_scanner_status();
} else if (pid == -1) {
- MS_DBG("%s", strerror(errno));
+ MS_DBG_ERR("%s", strerror(errno));
}
if (WIFEXITED(stat)) {
- MS_DBG("normal termination , exit status : %d", WEXITSTATUS(stat));
+ MS_DBG_ERR("normal termination , exit status : %d", WEXITSTATUS(stat));
} else if (WIFSIGNALED(stat)) {
- MS_DBG("abnormal termination , signal number : %d", WTERMSIG(stat));
+ MS_DBG_ERR("abnormal termination , signal number : %d", WTERMSIG(stat));
} else if (WIFSTOPPED(stat)) {
- MS_DBG("child process is stoped, signal number : %d", WSTOPSIG(stat));
+ MS_DBG_ERR("child process is stoped, signal number : %d", WSTOPSIG(stat));
}
return;
}
}
- MS_DBG("Received [%d](%d) [%s]", recv_msg.msg_type, recv_msg.msg_size, recv_msg.msg);
+// MS_DBG("Received [%d](%d) [%s]", recv_msg.msg_type, recv_msg.msg_size, recv_msg.msg);
if((recv_msg.msg_size <= 0) ||(recv_msg.msg_size > MS_FILE_PATH_LEN_MAX) || (!MS_STRING_VALID(recv_msg.msg))) {
MS_DBG_ERR("invalid query. size[%d]", recv_msg.msg_size);
+ MS_DBG_ERR("Received [%d](%d) [%s]", recv_msg.msg_type, recv_msg.msg_size, recv_msg.msg);
close(client_sock);
return TRUE;
}
break;
}
} else {
- MS_DBG_ERR("media-server: Looking for process of name: [%s]. Cannot find. Reason: %s",
- THUMB_SERVER_NAME, strerror(errno));
+ MS_DBG_ERR("Can't read file [%s]", path);
}
}
{
if (errno == EWOULDBLOCK) {
MS_DBG_ERR("Timeout. Can't try any more");
+ if (!_ms_thumb_check_process()) {
+ MS_DBG_ERR("Thumbnail server is not running!. Reset info for thumb server to execute");
+ ms_thumb_reset_server_status();
+ }
+
return MS_MEDIA_ERR_SOCKET_RECEIVE_TIMEOUT;
} else {
MS_DBG_ERR("recvfrom failed : %s", strerror(errno));