[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-server-cvs
Subject: [Server-cvs] engine/context cdist_wrappers.cpp,1.5,1.6
From: tniu () helixcommunity ! org
Date: 2013-11-25 11:21:48
[Download RAW message or body]
Update of /cvsroot/server/engine/context
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv8583
Modified Files:
cdist_wrappers.cpp
Log Message:
Synopsis
========
CR: Cache support for vhost.
Branches: SERVER_15_1_0_RN, HEAD
Suggested Reviewers: Anyone
Description
===========
Add Cache support for vhost.
Files Affected
==============
server-restricted/cdist/cdadplin/cdadplin.cpp
server-restricted/cdist/cdadplin/cdadplin.h
server-restricted/cdist/cdistpln/cdistpln.cpp
server-restricted/cdist/cdistpln/cdistpln.h
server-restricted/cache/rncache/rncf.cpp
server/engine/dataflow/fsmanager.cpp
server/engine/context/cdist_wrappers.cpp
server/engine/context/pub/cdist_wrappers.h
server/common/util/pub/cdist_defs.h
server_rn/common/util/vhostapi.cpp
Testing Performed
=================
Platforms Tested: win-x86_64-vc10
Build verified: win-x86_64-vc10
QA Hints
========
None
Index: cdist_wrappers.cpp
===================================================================
RCS file: /cvsroot/server/engine/context/cdist_wrappers.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cdist_wrappers.cpp 4 Sep 2003 22:35:34 -0000 1.5
+++ cdist_wrappers.cpp 25 Nov 2013 11:21:45 -0000 1.6
@@ -211,7 +211,8 @@
* list in the proc container, in a manner similar to the fs plugins.
*/
CDistAdviseWrapper::CDistAdviseWrapper(IUnknown* pContext,
- Process* proc)
+ Process* proc,
+ char *pVhostAccount)
: m_lRefCount(0)
, m_pPluginList(proc->pc->cached_cdist_advise_list)
, m_bOK(TRUE)
@@ -226,90 +227,113 @@
if (!zm_bLicensedSubscriberValid)
{
- // check the license
+ // check the license
- INT32 tmp;
- IHXRegistry* pRegistry=NULL;
- pContext->QueryInterface(IID_IHXRegistry,
- (void**)&pRegistry);
+ INT32 tmp;
+ IHXRegistry* pRegistry=NULL;
+ pContext->QueryInterface(IID_IHXRegistry,
+ (void**)&pRegistry);
- if (!pRegistry ||
- pRegistry->GetIntByName(REGISTRY_CDIST_SUBSCRIBER, tmp) != HXR_OK)
- {
- tmp = LICENSE_CDIST_SUBSCRIBER;
- }
+ if (!pRegistry ||
+ pRegistry->GetIntByName(REGISTRY_CDIST_SUBSCRIBER, tmp) != HXR_OK)
+ {
+ tmp = LICENSE_CDIST_SUBSCRIBER;
+ }
- zm_bLicensedSubscriber = (tmp != 0);
- zm_bLicensedSubscriberValid = TRUE;
+ zm_bLicensedSubscriber = (tmp != 0);
+ zm_bLicensedSubscriberValid = TRUE;
- if (!zm_bLicensedSubscriber)
- {
- CDPRINTF(D_INFO, ("Not a licensed subscriber for "
- "content distribution.\n"));
- }
+ if (!zm_bLicensedSubscriber)
+ {
+ CDPRINTF(D_INFO, ("Not a licensed subscriber for "
+ "content distribution.\n"));
+ }
- // check whether cdist specified in .cfg
+ // check whether cdist specified in .cfg
- if (pRegistry)
- {
- if (pRegistry->GetId(CDIST_REGISTRY_ROOT))
- {
- zm_bCDistConfigPresent = TRUE;
+ if (pRegistry)
+ {
+ CHXString sCdistRegistryRoot;
+ CHXString sCdistRegistrySubEnabled;
+ CHXString sCdistRegistryStatistics;
+ CHXString sCdistRegistryRTSPImport;
+ if (pVhostAccount)
+ {
+ sCdistRegistryRoot = "vhost.";
+ sCdistRegistrySubEnabled = "vhost.";
+ sCdistRegistryStatistics = "server.vhost.";
+ sCdistRegistryRTSPImport = "vhost.";
+ sCdistRegistryRoot = sCdistRegistryRoot + pVhostAccount + \
CDIST_REGISTRY_ROOT_VHOST; + sCdistRegistrySubEnabled = \
sCdistRegistrySubEnabled + pVhostAccount + CDIST_REGISTRY_SUB_ENABLED_VHOST; + \
sCdistRegistryStatistics = sCdistRegistryStatistics + pVhostAccount + \
CDIST_REGISTRY_STATISTICS_VHOST; + sCdistRegistryRTSPImport = \
sCdistRegistryRTSPImport + pVhostAccount + CDIST_REGISTRY_RTSP_IMPORT_VHOST; + \
} + else
+ {
+ sCdistRegistryRoot = CDIST_REGISTRY_ROOT;
+ sCdistRegistrySubEnabled = CDIST_REGISTRY_SUB_ENABLED;
+ sCdistRegistryStatistics = CDIST_REGISTRY_STATISTICS;
+ sCdistRegistryRTSPImport = CDIST_REGISTRY_RTSP_IMPORT;
+ }
+
+ if (pRegistry->GetId(sCdistRegistryRoot))
+ {
+ zm_bCDistConfigPresent = TRUE;
- // if cdist is enabled in registry, but not licensed,
- // print a warning.
- if (!zm_bLicensedSubscriber)
- {
- INT32 enabled;
- if (HXR_OK == pRegistry->
- GetIntByName(CDIST_REGISTRY_SUB_ENABLED, enabled) &&
- enabled)
- {
- IHXErrorMessages* pLog = NULL;
- pContext->QueryInterface(IID_IHXErrorMessages, (void**)&pLog);
- pLog->Report(HXLOG_WARNING,
- HXR_NOT_LICENSED,
- 0,
- "CDist: Content Distribution feature is "
- "configured but not licensed.",
- "");
- HX_RELEASE (pLog);
- }
- }
- }
- else
- {
- zm_bCDistConfigPresent = FALSE;
- }
+ // if cdist is enabled in registry, but not licensed,
+ // print a warning.
+ if (!zm_bLicensedSubscriber)
+ {
+ INT32 enabled;
+ if (HXR_OK == pRegistry->
+ GetIntByName(sCdistRegistrySubEnabled, enabled) &&
+ enabled)
+ {
+ IHXErrorMessages* pLog = NULL;
+ pContext->QueryInterface(IID_IHXErrorMessages, (void**)&pLog);
+ pLog->Report(HXLOG_WARNING,
+ HXR_NOT_LICENSED,
+ 0,
+ "CDist: Content Distribution feature is "
+ "configured but not licensed.",
+ "");
+ HX_RELEASE (pLog);
+ }
+ }
+ }
+ else
+ {
+ zm_bCDistConfigPresent = FALSE;
+ }
- // get cdist stats struct - has copy of registry's "enabled" var
- // Referring to a cached pointer is more efficient than getting
- // CDIST_REGISTRY_SUB_ENABLED every time.
+ // get cdist stats struct - has copy of registry's "enabled" var
+ // Referring to a cached pointer is more efficient than getting
+ // CDIST_REGISTRY_SUB_ENABLED every time.
- IHXBuffer* pBuf = NULL;
- if (HXR_OK == pRegistry->GetBufByName(CDIST_REGISTRY_STATISTICS, pBuf))
- {
- zm_pMIIStats = *((CDistMIIStatistics**)pBuf->GetBuffer());
- pBuf->Release();
- }
+ IHXBuffer* pBuf = NULL;
+ if (HXR_OK == pRegistry->GetBufByName(sCdistRegistryStatistics, pBuf))
+ {
+ zm_pMIIStats = *((CDistMIIStatistics**)pBuf->GetBuffer());
+ pBuf->Release();
+ }
- // check for forced transport
+ // check for forced transport
- if (HXR_OK != pRegistry->GetIntByName(CDIST_REGISTRY_RTSP_IMPORT, tmp))
- {
- tmp = CDIST_DEFAULT_RTSP_IMPORT;
- }
- zm_bForceRTSPImport = (tmp != 0);
+ if (HXR_OK != pRegistry->GetIntByName(sCdistRegistryRTSPImport, tmp))
+ {
+ tmp = CDIST_DEFAULT_RTSP_IMPORT;
+ }
+ zm_bForceRTSPImport = (tmp != 0);
- pRegistry->Release();
- }
+ pRegistry->Release();
+ }
}
if (!zm_bLicensedSubscriber || !zm_bCDistConfigPresent ||
!zm_pMIIStats || !zm_pMIIStats->m_ubEnabled)
{
- m_bOK = FALSE;
- return;
+ m_bOK = FALSE;
+ return;
}
// get or build the proc's plugin list
_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic