[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-common-dev
Subject:    [Common-dev] CR: shared resolver address info cache implementation
From:       Qiang Luo <qluo () real ! com>
Date:       2010-10-25 6:28:02
Message-ID: 4CC52372.5080701 () real ! com
[Download RAW message or body]

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.


Overview:
Helix file system creates resolver to do dns lookup for each 
connection.  It doesn't cache the address info data.  This haven't been 
any issue until recently where we need to create httpfileobj frequently 
to handle httplive streaming's usage.  For httplive streaming, there can 
be 3 httpfsys connections, playlist update, ts segment file downloading, 
decryption key downloading for each segment.  The typical segment 
duration is 6 to10 seconds.  In this case, a resolver-addressInfo cache 
would be beneficial in improve the httpfilesystem performance.

In this implementation, we create a sheared map to store the address 
info data/objects.  Instead of having a global map for a process, we 
create a single map for the singleton media platform.

Branches:
head, hxclient_3_1_0_atlas

files added:
common/include/ihxaddressinfomap.h
common/util/hxaddrinfomap.cpp
common/util/pub/hxaddrinfomap.h

files modified:
common/util/Umakefil
client/medpltfm/chxmedpltfm.cpp
client/medpltfm/dlliids.cpp
client/medpltfm/pub/chxmedpltfm.h
filesystem/http/factory.cpp
filesystem/http/httpfsys.cpp
filesystem/http/httpfsys.h

Please review the implementation

Thanks,
Qiang

["util_diff.txt" (text/plain)]

Index: Umakefil
===================================================================
RCS file: /cvsroot/common/util/Umakefil,v
retrieving revision 1.44.2.5
diff -u -r1.44.2.5 Umakefil
--- Umakefil	24 Sep 2010 19:32:52 -0000	1.44.2.5
+++ Umakefil	25 Oct 2010 06:14:03 -0000
@@ -142,7 +142,8 @@
 		   "hxabdutil.cpp",
                    "hxmovavg.cpp",
                    "hxmovmed.cpp",
-		   "HXErrorCodeStrings.c")
+		   "HXErrorCodeStrings.c",
+                   "hxaddrinfomap.cpp")
 		   
 project.AddSources("tconverter/fxpoint/tconverter_fxp.cpp")
 

["httpfsys_diff.txt" (text/plain)]

Index: factory.cpp
===================================================================
RCS file: /cvsroot/filesystem/http/factory.cpp,v
retrieving revision 1.10
diff -u -w -r1.10 factory.cpp
--- factory.cpp	6 Jul 2007 20:48:08 -0000	1.10
+++ factory.cpp	25 Oct 2010 06:08:56 -0000
@@ -89,6 +89,7 @@
 #include "ihxfgbuf.h"
 #include "ihxident.h"
 #include "ihxperplex.h"
+#include "ihxaddressinfomap.h"
 
 #if defined(HELIX_FEATURE_PROGRESSIVE_DOWNLD_STATUS)
 #include "hxprdnld.h"
Index: httpfsys.cpp
===================================================================
RCS file: /cvsroot/filesystem/http/httpfsys.cpp,v
retrieving revision 1.109.2.25
diff -u -w -r1.109.2.25 httpfsys.cpp
--- httpfsys.cpp	11 Oct 2010 15:48:48 -0000	1.109.2.25
+++ httpfsys.cpp	25 Oct 2010 06:08:56 -0000
@@ -93,6 +93,8 @@
 #include "hxtick.h"
 #include "hxurl.h"
 #include "hxscope_lock.h"
+#include "ihxaddressinfomap.h"
+#include "hxaddrinfomap.h"
 
 #if defined(HELIX_FEATURE_PROGRESSIVE_DOWNLD_STATUS)
 #include "hxprdnld.h"
@@ -184,6 +186,7 @@
 
 #define AUTORECONNECT_MAX_RETRIES   30
 #define CONNECTIONRETRY_WAIT_TIME   1000
+#define ADDRINFO_PURGE_THRESHOLD    1800000 /* 30 minute */
 
 // default if no timeouts in preferences.
 #define DEF_HTTP_SERVER_TIMEOUT     (20 * MILLISECS_PER_SECOND)
@@ -1012,6 +1015,8 @@
  */
     , m_pSocket(NULL)
     , m_pResolve(NULL)
+    , m_pAddressInfoCacheMgr(NULL)
+    , m_bUseCachedAddressInfo(FALSE)
 
     , m_bHTTP1_1(TRUE)
 
@@ -1205,6 +1210,7 @@
         m_pContext->QueryInterface(IID_IHXInterruptState, \
(void**)&m_pInterruptState);  m_pContext->QueryInterface(IID_IHXCookies, \
                (void**)&m_pCookies);
         m_pContext->QueryInterface(IID_IHXCookies2, (void**)&m_pCookies2);
+        m_pContext->QueryInterface(IID_IHXAddressInfoMap, \
(void**)&m_pAddressInfoCacheMgr);  
         // Figure out if we're on the server
         IHXServerControl* pServerControl = NULL;
@@ -1581,6 +1587,8 @@
         HX_RELEASE(m_pResolve);
     }
     
+    HX_RELEASE(m_pAddressInfoCacheMgr);
+
     if (m_pSocket)
     {
         m_pSocket->Close();
@@ -3705,14 +3713,64 @@
 
     if (!m_pSocket)
     {
-        // Ensure resolver and response objects are created and initialized
-        theErr = _DoResolverSetup();
-        if (SUCCEEDED(theErr))
-        {
             // Put the port in string form
             UINT16 usTmpPort = GetActualPort();
             char szPort[HX_PORTSTRLEN]; /* Flawfinder: ignore */
             sprintf(szPort, "%u", usTmpPort);
+
+        // try lookup the address info from cache before creating resolver
+        m_bUseCachedAddressInfo = FALSE;
+        CHXAddressInfoData* pCHXAddressInfoData = NULL;
+
+        if (m_pAddressInfoCacheMgr)
+        {
+            m_StrHostPort = pActualHost;
+            m_StrHostPort = m_StrHostPort + ":";
+            m_StrHostPort = m_StrHostPort + szPort;
+            m_pAddressInfoCacheMgr->LookupAddressInfo((const char*)m_StrHostPort, \
(void**)&pCHXAddressInfoData); +            if (pCHXAddressInfoData)
+            {
+                UINT32 ulAge = HX_GET_BETTERTICKCOUNT() - \
pCHXAddressInfoData->m_ulTime; +                if (ulAge > ADDRINFO_PURGE_THRESHOLD)
+                {
+                    m_pAddressInfoCacheMgr->PurgeAddressInfo((const \
char*)m_StrHostPort); +                }
+                else
+                {
+                    m_bUseCachedAddressInfo = TRUE;
+                }
+
+            }
+        }
+
+        if (m_bUseCachedAddressInfo)
+        {
+            // Create the response for the socket
+            if(!m_pTCPResponse)
+            {
+                m_pTCPResponse = HTTPTCPResponse::CreateObject();
+                if (m_pTCPResponse)
+                {
+                    m_pTCPResponse->InitObject(this);
+                    m_pTCPResponse->AddRef();
+                }
+                else
+                {
+                    return HXR_OUTOFMEMORY;
+                }
+            }
+
+            // we internally call GetAddrInfoDone()
+            UINT32 nVecLen = pCHXAddressInfoData->m_ulCount;
+            IHXSockAddr** ppAddrVec = pCHXAddressInfoData->m_ppAddrVec;
+            theErr = GetAddrInfoDone(HXR_OK, nVecLen, ppAddrVec);
+        }
+        else
+        {
+            // Ensure resolver and response objects are created and initialized
+            theErr = _DoResolverSetup();
+            if (SUCCEEDED(theErr))
+            {
             // Call IHXResolve::GetAddrInfo() to resolve the host name
             theErr = m_pResolve->GetAddrInfo(pActualHost, szPort, NULL);
             if (SUCCEEDED(theErr))
@@ -3735,6 +3793,7 @@
                 }
             }
         }
+        }
 
     }
     else
@@ -3802,6 +3861,25 @@
     HXLOGL1(HXLOG_HTTP, "GetAddrInfoDone status %08x (going to create socket)", \
status);  HX_RESULT retVal = HXR_FAIL;
 
+    // add to shared address info cache map
+    if (SUCCEEDED(status) && !m_bUseCachedAddressInfo && ppAddrVec && nVecLen && \
m_pAddressInfoCacheMgr) +    {
+        CHXAddressInfoData* pCHXAddressInfoData = (CHXAddressInfoData*) new \
CHXAddressInfoData(); +        // time stamp
+        pCHXAddressInfoData->m_ulTime = HX_GET_BETTERTICKCOUNT();
+        // count
+        pCHXAddressInfoData->m_ulCount = nVecLen;
+        // address info objects
+        pCHXAddressInfoData->m_ppAddrVec = new IHXSockAddr*[nVecLen];
+        for (int i = 0; i < nVecLen; i++)
+        {
+            HX_ADDREF(ppAddrVec[i]);
+            pCHXAddressInfoData->m_ppAddrVec[i] = ppAddrVec[i];
+        }
+        m_pAddressInfoCacheMgr->AddAddressInfo((const char*)m_StrHostPort, (void*) \
pCHXAddressInfoData); +        pCHXAddressInfoData = NULL;
+    }
+
     if (m_pContext && m_pTCPResponse)
     {
         // Clear the return value
Index: httpfsys.h
===================================================================
RCS file: /cvsroot/filesystem/http/httpfsys.h,v
retrieving revision 1.40.2.6
diff -u -w -r1.40.2.6 httpfsys.h
--- httpfsys.h	8 Oct 2010 21:18:39 -0000	1.40.2.6
+++ httpfsys.h	25 Oct 2010 06:08:56 -0000
@@ -86,6 +86,7 @@
 struct IHXSockAddr;
 struct IHXSocket;
 struct IHXResolve;
+struct IHXAddressInfoMap;
 
 class CHXString;
 class CChunkyRes;
@@ -98,6 +99,8 @@
 class HTTPTCPResponse;
 class HTTPFileObjCallback;
 
+class CHXAddressInfoData;
+
 
 #define MAX_CHUNK_SIZE     1024 //max size of chunk in hex digits.
 #define DEFAULT_CHUNK_SIZE 1024 //default size of chunk buffer
@@ -867,6 +870,9 @@
      */
     IHXSocket*                  m_pSocket;
     IHXResolve*                 m_pResolve;
+    IHXAddressInfoMap*          m_pAddressInfoCacheMgr;
+    CHXString                   m_StrHostPort;
+    HXBOOL                      m_bUseCachedAddressInfo;
 
     HXBOOL                        m_bHTTP1_1;
 


["hxaddrinfomap.cpp" (text/plain)]

/* ***** BEGIN LICENSE BLOCK *****
 *
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#include "hxcom.h"
#include "hxtypes.h"
#include "hxcomm.h"
#include "hxmap.h"
#include "hxaddrinfomap.h"
#include "pckunpck.h"

// IUnknown interface listing
BEGIN_INTERFACE_LIST(CHXAddressInfoCacheMap)
    INTERFACE_LIST_ENTRY(IID_IHXAddressInfoMap, IHXAddressInfoMap)
END_INTERFACE_LIST

CHXAddressInfoCacheMap::CHXAddressInfoCacheMap()
    : m_pAddrInfoMap(NULL)
    , m_pMutex(NULL)
{
}

CHXAddressInfoCacheMap::~CHXAddressInfoCacheMap()
{
    Close();
}

/*
 *  IHXAddressInfoMap methods
 */
STDMETHODIMP
CHXAddressInfoCacheMap::Init(IUnknown* pContext)
{
    if (pContext)
    {
        m_pAddrInfoMap = new CHXMapStringToOb();
        CreateInstanceCCF(CLSID_IHXMutex, (void**)&m_pMutex, pContext);
        if (m_pAddrInfoMap && m_pMutex)
        {
            return HXR_OK;
        }
    }
    return HXR_FAIL;
}


STDMETHODIMP
CHXAddressInfoCacheMap::PurgeAddressInfo(const char* pKey)
{
    if (m_pAddrInfoMap && pKey)
    {
        m_pAddrInfoMap->RemoveKey(pKey);
    }
    return HXR_OK;
}

STDMETHODIMP
CHXAddressInfoCacheMap::AddAddressInfo(const char* pKey, void* pAddrInfoObj)
{
    if (!m_pAddrInfoMap || !m_pMutex || !pKey || !pAddrInfoObj)
    {
        return HXR_FAIL;
    }

    m_pMutex->Lock();
    m_pAddrInfoMap->SetAt(pKey, pAddrInfoObj);
    m_pMutex->Unlock();

    return HXR_OK;
}

STDMETHODIMP
CHXAddressInfoCacheMap::LookupAddressInfo(const char* pKey, void** ppAddrInfoDataOut)
{
    m_pMutex->Lock();

    *ppAddrInfoDataOut = NULL;
    HX_RESULT retVal = HXR_FAIL;
    CHXAddressInfoData* pCHXAddressInfoData = NULL;

    if (pKey && m_pAddrInfoMap)
    {
        m_pAddrInfoMap->Lookup(pKey, (void*&)pCHXAddressInfoData);
    }

    if (pCHXAddressInfoData)
    {
        *ppAddrInfoDataOut = pCHXAddressInfoData;
        retVal = HXR_OK;
    }

    m_pMutex->Unlock();

    return retVal;
}

STDMETHODIMP
CHXAddressInfoCacheMap::Close()
{
    if (m_pAddrInfoMap)
    {
        CHXMapStringToOb::Iterator i;
        for(i = m_pAddrInfoMap->Begin(); i != m_pAddrInfoMap->End(); ++i)
        {
            CHXAddressInfoData* pCHXAddressInfoData = (CHXAddressInfoData*)(*i);
            HX_DELETE(pCHXAddressInfoData);
        }
        HX_DELETE(m_pAddrInfoMap);
    }

    HX_RELEASE(m_pMutex);
    return HXR_OK;
}


CHXAddressInfoData::CHXAddressInfoData()
    : m_ulTime(0)
    , m_ulCount(0)
    , m_ppAddrVec(NULL)
{
}

CHXAddressInfoData::~CHXAddressInfoData()
{
    if (m_ulCount)
    {
        for (int i = 0; i < m_ulCount; i++)
        {
            HX_RELEASE(m_ppAddrVec[i]);
        }
    }
}

["hxaddrinfomap.h" (text/plain)]

/* ***** BEGIN LICENSE BLOCK *****
 *
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef _CHXADDRESS_INFOMAP_H_
#define _CHXADDRESS_INFOMAP_H_

#include "ihxaddressinfomap.h"
#include "unkimp.h"
#include "hxnet.h"

class CHXAddressInfoCacheMap :  public IHXAddressInfoMap,
                                public CUnknownIMP
{
    // the IUnknown implementation declaration
    DECLARE_UNKNOWN(CHXAddressInfoCacheMap)

public:
    CHXAddressInfoCacheMap              ();
    ~CHXAddressInfoCacheMap             ();

    // IHXAddressInfoMap
    STDMETHOD(Init)                     (THIS_ IUnknown* pContext);
    STDMETHOD(PurgeAddressInfo)         (THIS_ const char* pKey);
    STDMETHOD(AddAddressInfo)           (THIS_ const char* pKey, void* pAddrInfoObj);
    STDMETHOD(LookupAddressInfo)        (THIS_ const char* pKey, void **ppAddrInfoDataOut);
    STDMETHOD(Close)                    (THIS);

private:
    IUnknown*                           m_pContext;
    IHXMutex*                           m_pMutex;
    CHXMapStringToOb*                   m_pAddrInfoMap;
};

class CHXAddressInfoData
{
public:
    CHXAddressInfoData();
    ~CHXAddressInfoData();

    UINT32                  m_ulTime;
    UINT32                  m_ulCount;
    IHXSockAddr**           m_ppAddrVec;
};

#endif /* _CHXADDRESS_INFOMAP_H_ */

["ihxaddressinfomap.h" (text/plain)]

/* ***** BEGIN LICENSE BLOCK *****
 *
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef _IHXADDRESSINFO_MAP_H_
#define _IHXADDRESSINFO_MAP_H_

#include "hxcom.h"

typedef _INTERFACE   IHXBuffer		    IHXBuffer;

/****************************************************************************
 * 
 *  Interface:
 * 
 *	IHXAddressInfoMap
 * 
 *  Purpose:
 * 
 *	This interface provides methods to add/lookup address info 
 *      to cache resolver data
 * 
 *      IID_IHXAddressInfoMap:
 * 
 *	{B936A2D6-330D-49c8-9CDE-9768BEE3FE1E}
 * 
 */
DEFINE_GUID(IID_IHXAddressInfoMap, 0xb936a2d6, 0x330d, 0x49c8, 0x9c, 0xde, 0x97, \
0x68, 0xbe, 0xe3, 0xfe, 0x1e);

#undef  INTERFACE
#define INTERFACE   IHXAddressInfoMap
#define CLSID_IHXAddressInfoMap IID_IHXAddressInfoMap

DECLARE_INTERFACE_(IHXAddressInfoMap, IUnknown)
{
    /*
     *  IUnknown methods
     */
    STDMETHOD(QueryInterface)           (THIS_ REFIID riid, void** ppvObj) PURE;
    STDMETHOD_(ULONG32,AddRef)          (THIS) PURE;
    STDMETHOD_(ULONG32,Release)         (THIS) PURE;

    /*
     *  IHXAddressInfoMap methods
     */
    STDMETHOD(Init)                     (THIS_ IUnknown* pContext) PURE;
    STDMETHOD(PurgeAddressInfo)         (THIS_ const char* pKey) PURE;
    STDMETHOD(AddAddressInfo)           (THIS_ const char* pKey, void* pAddrInfoObj) \
PURE;  STDMETHOD(LookupAddressInfo)        (THIS_ const char* pKey, void** \
ppAddrInfoDataOut) PURE;  STDMETHOD(Close)                    (THIS) PURE;
};

#include "hxcomptr.h"
DEFINE_SMART_PTR(IHXAddressInfoMap)

#endif /* _IHXADDRESSINFO_MAP_H_ */


["medpltfm_fiff.txt" (text/plain)]

Index: chxmedpltfm.cpp
===================================================================
RCS file: /cvsroot/client/medpltfm/chxmedpltfm.cpp,v
retrieving revision 1.51.2.24
diff -u -r1.51.2.24 chxmedpltfm.cpp
--- chxmedpltfm.cpp	23 Apr 2010 22:47:45 -0000	1.51.2.24
+++ chxmedpltfm.cpp	25 Oct 2010 06:05:12 -0000
@@ -97,6 +97,7 @@
 #include "hxstrutl.h"
 #include "dbcs.h"
 #include "thrdutil.h"
+#include "hxaddrinfomap.h"
 
 #include "hxtlogutil.h"
 
@@ -133,6 +134,7 @@
     ,m_pOptimizedScheduler2(NULL)
     ,m_pMutex(NULL)
     ,m_pNetServices(NULL)
+    ,m_pAddressInfoCacheObj(NULL)
 #ifdef HELIX_FEATURE_PROGDOWN
     ,m_pDownloadMgr(NULL)
 #endif
@@ -427,6 +429,12 @@
     }
 #endif
 
+    if (m_pAddressInfoCacheObj)
+    {
+        m_pAddressInfoCacheObj->Close();
+        HX_RELEASE(m_pAddressInfoCacheObj);
+    }
+
     if (m_pChildren)
     {
         CHXSimpleList::Iterator i;
@@ -1325,6 +1333,24 @@
                 }
             }
 #endif /* HELIX_FEATURE_AUTOUPGRADE */
+
+            if (IsEqualIID(riid, IID_IHXAddressInfoMap))
+            {
+                if (!m_pAddressInfoCacheObj)
+                {
+                    m_pAddressInfoCacheObj = (IHXAddressInfoMap*)(new CHXAddressInfoCacheMap());
+                    if (m_pAddressInfoCacheObj)
+                    {
+                        HX_ADDREF(m_pAddressInfoCacheObj);
+                        m_pAddressInfoCacheObj->Init((IUnknown*)(IHXMediaPlatform*)this);
+                    }
+                }
+
+                if (m_pAddressInfoCacheObj)
+                {
+                    rc = m_pAddressInfoCacheObj->QueryInterface(riid, ppvObj);
+                }
+            }
         }
     }
 
Index: dlliids.cpp
===================================================================
RCS file: /cvsroot/client/medpltfm/dlliids.cpp,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 dlliids.cpp
--- dlliids.cpp	13 Dec 2007 18:57:31 -0000	1.6.2.1
+++ dlliids.cpp	25 Oct 2010 06:05:12 -0000
@@ -54,6 +54,7 @@
 #include "hxccf.h"
 #include "hxiids.h"
 #include "hxpiids.h"
+#include "ihxaddressinfomap.h"
 
 #ifdef HELIX_FEATURE_PROGDOWN
     #include "ihxdownloadmgr.h"
Index: pub/chxmedpltfm.h
===================================================================
RCS file: /cvsroot/client/medpltfm/pub/chxmedpltfm.h,v
retrieving revision 1.19.2.6
diff -u -r1.19.2.6 chxmedpltfm.h
--- pub/chxmedpltfm.h	6 Jun 2008 00:37:44 -0000	1.19.2.6
+++ pub/chxmedpltfm.h	25 Oct 2010 06:05:12 -0000
@@ -80,6 +80,7 @@
 #include "ihxcookies.h"
 #include "cookhlpr.h"
 #include "cookies.h"
+#include "ihxaddressinfomap.h"
 
 #if defined(_STATICALLY_LINKED) || !defined(HELIX_FEATURE_PLUGINHANDLER2)
 #if defined(HELIX_CONFIG_CONSOLIDATED_CORE)
@@ -146,6 +147,7 @@
     IHXMutex*		    m_pMutex;
     IHXRegistry*	    m_pRegistry;
     IHXNetServices*	    m_pNetServices;
+    IHXAddressInfoMap*      m_pAddressInfoCacheObj;
 
 #ifdef HELIX_FEATURE_PROGDOWN
     IHXDownloadManager*     m_pDownloadMgr;


_______________________________________________
Common-dev mailing list
Common-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/common-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic