From: Mahendra Kumar Prajapat Date: Tue, 28 Aug 2012 09:18:35 +0000 (+0530) Subject: drm-client for tizen 2.0 X-Git-Tag: 2.0_alpha~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e8d73c4d6de45e9f043cd14e7af1e2d17bc5798;p=platform%2Fcore%2Fsecurity%2Fdrm-client.git drm-client for tizen 2.0 --- diff --git a/include/drm_client_ipc.h b/include/drm_client_ipc.h index e8303f7..46cc60d 100755 --- a/include/drm_client_ipc.h +++ b/include/drm_client_ipc.h @@ -72,7 +72,7 @@ extern "C" { /** * Maximum concurrent clients supported */ -#define DRM_MAX_CLIENT_SUPPORTED 5 +#define DRM_MAX_CLIENT_SUPPORTED 10 /** * Maximum callback data size @@ -136,8 +136,6 @@ typedef struct { * @remark It can be used to track drm clients. */ typedef struct { - /** Active state for structure */ - int active; /** Client Id */ int client_id; diff --git a/include/drm_client_types.h b/include/drm_client_types.h index d069ea6..97c7235 100755 --- a/include/drm_client_types.h +++ b/include/drm_client_types.h @@ -154,7 +154,7 @@ extern "C" { /* * Max length of Order ID */ -#define DRM_MAX_LEN_ORDER_ID (15) +#define DRM_MAX_LEN_ORDER_ID (23) /* * Max length of Service ID diff --git a/packaging/drm-client.spec b/packaging/drm-client.spec index 6bbc24d..e2b722e 100755 --- a/packaging/drm-client.spec +++ b/packaging/drm-client.spec @@ -1,6 +1,6 @@ Name: drm-client Summary: DRM client Package -Version: 0.0.23 +Version: 0.0.26 Release: 0 Group: TO_BE/FILLED_IN License: Apache diff --git a/service/drm_client_ipc.cpp b/service/drm_client_ipc.cpp index 478c71a..8781311 100755 --- a/service/drm_client_ipc.cpp +++ b/service/drm_client_ipc.cpp @@ -120,33 +120,43 @@ void __search_client_info_cb(drm_client_cb_data_s* callinfo) * @see * @since 0.1 */ -void *client_async_cb_handler(void *thread_arg) -{ +void *client_async_cb_handler(void *thread_arg) { drm_client_cb_data_s callinfo; int retval = 0, result = 0; - memset(&callinfo, 0x00, sizeof(drm_client_cb_data_s)); /* This Async thread will be running for the entire process alive time * to handle all the async related operations sent from the server */ - while(1) - { - /* waiting for data on async socket */ - if ((retval = read(async_sockfd, &callinfo, sizeof(drm_client_cb_data_s))) < 0) { - DRM_CLIENT_EXCEPTION(" Async call_back read error!!, retval = %d, error = %s", - retval, strerror(errno)); - result = DRM_RETURN_COMMUNICATION_ERROR; + while (1) { + memset(&callinfo, 0x00, sizeof(drm_client_cb_data_s)); + retval = read(async_sockfd, &callinfo, sizeof(drm_client_cb_data_s)); + if (0 == retval) { + DRM_CLIENT_LOG("Read returns 0!, retval = %d", retval); + DRM_CLIENT_LOG("Server end closed!!!!"); + /* Since server end closes + * async socket creation needs to be done again + */ goto ErrorExit; + } else if (retval < 0 || retval < sizeof(drm_client_cb_data_s)) { + DRM_CLIENT_EXCEPTION( + " Async call_back read error!!, retval = %d, error = %s", + retval, strerror(errno)); } - DRM_CLIENT_LOG("Calling application call back function from client"); - - /* Search the client cb info from the received client_id and call corresponding handler */ - __search_client_info_cb(&callinfo); - } - ErrorExit: - if(-1 != async_sockfd) - close(async_sockfd); - return NULL; + + DRM_CLIENT_LOG( + "Calling application call back function from client, retval = %d", + retval); + /* Search the client cb info from the received client_id and call corresponding handler */ + __search_client_info_cb(&callinfo); + } + +ErrorExit: + pthread_mutex_lock(&async_mutex); + if (-1 != async_sockfd) + close(async_sockfd); + async_sockfd = -1; + pthread_mutex_unlock(&async_mutex); + return NULL; }