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

List:       helix-server-cvs
Subject:    [Server-cvs] engine/context/pub server_stats.h,1.46,1.47
From:       jzeng () helixcommunity ! org
Date:       2010-04-23 22:55:43
Message-ID: 201004232255.o3NMter3022543 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/context/pub
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv7165/server/engine/context/pub

Modified Files:
	server_stats.h 
Log Message:
ynopsis
============
Bug 244229:  All clients (existing and new all playing .hpl) disconnect when Max client connection
exceeds
Branches:  head, SERVER_14_0_RN, SERVER_14_1_RN Suggested Reviewer: anyone

Description
=========== 

The reason is that the second player got rejected but remained connected, and when the first player
need to switch and OnURL was called, now we exceeded the max connection and the first player got
rejected too.

This fix is simple: we need to remember that this connection had been counted and no need to check
again.  For this sspl bug it is simple, because we use the same instance of allowance plugin, and a
member variable would solve the problem.  But for smil and playnow3, we would have the same problem
but with different instances of the plugin, and we will need registry(as dauc did) or something else
to store the information.

So I create a new interface IHXExtendedStats and a new class CExtendedStats for this purpose.  This
class can be added to clientstats, sessionstats or clipstats to save and retrieve special
information.  We just need to use #define to specify the entries we want to add.

Currently I only added it to clientstats to fix this bug.  Later on we can add it to sessionStats,
in the case that we only need the communication, not the logging purpose.

Files Affected
==============
server/include/hxprivstats.h,v
server/include/server_piids.h,v
server/engine/context/server_stats.cpp,v
server/engine/context/pub/server_stats.h,v
server-restricted/access/allow/allow.cpp,v
server-restricted/access/allow/allow.h,v

Testing Performed
================= 

Unit Tests: 
None. 

Integration Tests: 
verify the bug is fixed.

Leak Tests: 
None. 

Performance Tests: 
- None 

Platforms Tested: win32-i386-vc7
Build verified: win32-i386-vc7




Index: server_stats.h
===================================================================
RCS file: /cvsroot/server/engine/context/pub/server_stats.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- server_stats.h	28 Feb 2010 03:42:37 -0000	1.46
+++ server_stats.h	23 Apr 2010 22:55:40 -0000	1.47
@@ -82,6 +82,7 @@
 
 _INTERFACE IHXClientStats2;
 _INTERFACE IHXPrivateClientStats;
+_INTERFACE IHXExtendedStats;
 
 // {793AB631-B654-4aae-99A3-0DF87258C363}
 DEFINE_GUID(IID_IHXClientStatsTimerControl, 0x793ab631, 0xb654, 0x4aae, 0x99, 
@@ -528,6 +529,8 @@
 
     Process* m_pProc;
 
+    IHXExtendedStats* m_pExtendedStats;
+
 public:
 
     ClientStats(Process* pProc);
@@ -841,4 +844,38 @@
     void SetClientStatsObject(IHXClientStats* pStats);
 
 };
+
+//XXXJJ This is a class designed for passing information carried by various
+// stats, including ClientStats, SessionStats and ClipStats. We don't need a
+// new interface for everything we want to add the stats anymore.
+
+//Currently I only use it in clientStats, but we can use it for sessionStats and 
+// clipStats later.
+
+class CExtendedStats: public IHXExtendedStats
+{
+public:
+
+    CExtendedStats(UINT32 ulStatsTableSize);
+    ~CExtendedStats();
+
+    // IUnknown methods.
+
+    STDMETHODIMP_(UINT32) AddRef();
+    STDMETHODIMP_(UINT32) Release();
+    STDMETHODIMP QueryInterface(REFIID riid, void** ppvObj);
+
+    //IHXExtendedStats
+    STDMETHOD(GetUINT32)            (THIS_ UINT32 ulID, UINT32& ulValue);
+    STDMETHOD(SetUINT32)            (THIS_ UINT32 ulID, UINT32 ulValue);
+
+    STDMETHOD(GetBuffer)            (THIS_ UINT32 ulID, IHXBuffer*& pBuffer);
+    STDMETHOD(SetBuffer)            (THIS_ UINT32 ulID, IHXBuffer* pBuffer);
+
+private:
+    INT32 m_lRefCount;
+    UINT32 m_ulTableSize;
+    UINT32** m_pUINT32Table;
+    IHXBuffer** m_pBufferTable;
+};
 #endif


_______________________________________________
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