From daeda521a8ac725bfba13a420db67c32851eda00 Mon Sep 17 00:00:00 2001 From: Young Ik Cho Date: Mon, 8 Apr 2013 22:50:00 +0900 Subject: [PATCH] Revert "Prevent fix" This reverts commit b0a4dd6067296a728bb4b27b1181c4b3bb599ae3 --- src/io/FIo_MessagePortProxy.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/io/FIo_MessagePortProxy.cpp b/src/io/FIo_MessagePortProxy.cpp index c377385..0f637b5 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,18 +72,16 @@ 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(); - SysTryReturnVoidResult(NID_IO, pMap != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + SysTryReturn(NID_IO, pMap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); result r = pBuffer->Construct(size); - 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."); + SysTryReturn(NID_IO, r == E_SUCCESS, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + pBuffer->SetArray((const byte*)pStr, 0, size); pBuffer->Flip(); pMap->Add(new (std::nothrow) String(pKey), pBuffer); @@ -95,9 +93,6 @@ ConvertBundleToMap(const char *pKey, const int type, const bundle_keyval_t *pVal break; } } - -CATCH: - return; } static void @@ -119,7 +114,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); @@ -134,6 +129,8 @@ 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 @@ -192,7 +189,6 @@ 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); } } -- 2.7.4