From: Sunwook Bae Date: Tue, 9 Apr 2013 01:41:53 +0000 (+0900) Subject: Revert "Revert "Prevent fix"" X-Git-Tag: accepted/tizen_2.1/20130425.034849~130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddae9c9ced7920ec3a12618f3da801df15bb3940;p=platform%2Fframework%2Fnative%2Fappfw.git Revert "Revert "Prevent fix"" This reverts commit daeda521a8ac725bfba13a420db67c32851eda00. Change-Id: I422eb5490febbd858659746e9d82de07e700e5b1 Signed-off-by: Sunwook Bae --- diff --git a/src/io/FIo_MessagePortProxy.cpp b/src/io/FIo_MessagePortProxy.cpp index 0f637b5..c377385 100644 --- a/src/io/FIo_MessagePortProxy.cpp +++ b/src/io/FIo_MessagePortProxy.cpp @@ -51,7 +51,7 @@ static const int MAX_MESSAGE_SIZE = 16 * 1024; static void ConvertBundleToMap(const char *pKey, const int type, const bundle_keyval_t *pVal, void *pData) { - SysLog(NID_IO, "CB key = %s", pKey); + //SysLog(NID_IO, "CB key = %s", pKey); HashMap* pMap = static_cast(pData); @@ -72,16 +72,18 @@ ConvertBundleToMap(const char *pKey, const int type, const bundle_keyval_t *pVal case BUNDLE_TYPE_BYTE: bundle_keyval_get_basic_val(const_cast(pVal), reinterpret_cast(&pStr), &size); - SysLog(NID_IO, "Bundle byte value = %s, size = %d", pStr, size); + //SysLog(NID_IO, "Bundle byte value = %s, size = %d", pStr, size); if (pStr) { ByteBuffer* pBuffer = new (std::nothrow) ByteBuffer(); - SysTryReturn(NID_IO, pMap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + SysTryReturnVoidResult(NID_IO, pMap != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); result r = pBuffer->Construct(size); - SysTryReturn(NID_IO, r == E_SUCCESS, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + SysTryCatch(NID_IO, r == E_SUCCESS, delete pBuffer, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + r = pBuffer->SetArray((const byte*)pStr, 0, size); + SysTryCatch(NID_IO, r == E_SUCCESS, delete pBuffer, E_INVALID_ARG, "[E_INVALID_ARG] The buffer argument is invalid."); - pBuffer->SetArray((const byte*)pStr, 0, size); pBuffer->Flip(); pMap->Add(new (std::nothrow) String(pKey), pBuffer); @@ -93,6 +95,9 @@ ConvertBundleToMap(const char *pKey, const int type, const bundle_keyval_t *pVal break; } } + +CATCH: + return; } static void @@ -114,7 +119,7 @@ OnMessageReceived(int id, const char* remote_app_id, const char* remote_port, bo return; } - SysLog(NID_IO, "local port name: %s", pLocalPort); + //SysLog(NID_IO, "local port name: %s", pLocalPort); _IMessagePortListener* pListener = null; p->__listeners.GetValue(pLocalPort, pListener); @@ -129,8 +134,6 @@ OnMessageReceived(int id, const char* remote_app_id, const char* remote_port, bo result r = pMap->Construct(); SysTryCatch(NID_IO, r == E_SUCCESS, delete pMap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - SysLog(NID_IO, "bundle to map"); - bundle_foreach(data, ConvertBundleToMap, pMap); if (remote_app_id == null) // Uni-directional @@ -189,6 +192,7 @@ OnTrustedMessageReceived(int id, const char* remote_app_id, const char* remote_p else // Bi-directional { SysLog(NID_IO, "Trusted message received from [%s:%s], trusted: %d", remote_app_id, remote_port, trusted_port); + pListener->OnMessageReceivedN(remote_app_id, remote_port, trusted_port, pMap); } }