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

List:       helix-server-cvs
Subject:    [Server-cvs] protocol/http/pub httpprot.h,1.33,1.34
From:       dcollins () helixcommunity ! org
Date:       2009-12-30 18:07:20
Message-ID: 200912301806.nBUI6oIE026342 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/protocol/http/pub
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv9145/pub

Modified Files:
	httpprot.h 
Log Message:
Synopsis
========
Adds Allowance-plugin related API support to HTTP

Branches: SERVER_CURRENT_RN (HEAD)
Reviewer: Chytanya


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

For DAUC to work with HTTP/1.1, one thing that has to happen is that the
HTTP code path needs to be able to invoke and interact with allowance
plugins.

RTSP does this via the ClientSession object, and the ton of other objects
and code that goes along with it, 99% of which is not relevant for HTTP.

For this reason, the HTTPAllow class was created.  This provides a
streamlined wrapper for interacting with allowance plugins.  HTTPProtocol
invokes the OnConnection, OnURL, OnBegin, OnStop and OnDone methods of
IHXPlayerConnectionAdviseSink as appropriate.  The Pause method does
not seem to apply.

For the most part HTTP doesn't care about the IHXPlayerConnectionResponse
allowance plugin responses except that we need to get our OnURLDone call
before we continue responding to the client.

Between OnURL and OnURLDone, the allowance plugin may call the
IXHPlayerController interface methods to disconnect or redirect the
client.  After that, they can only Disconnect() or AlertAndDisconnect()
the client.  Currently, the delay flag for NetworkRedirect is not
supported, this should be an add-on check-in.

This was tested with a modified version of the example plugin
(server/example/allowance) which I should check in for future
debugging usage.

The non-multiload allowance plugins are not supported, these do not
appear to apply for HTTP.  Allowance plugin serialization is not
implemented, and should not be if at all possible.


Files Affected
==============

server-restricted/protocol/http/httpallow.cpp [new]
server-restricted/protocol/http/pub/httpallow.h [new]
server-restricted/protocol/http/Umakefil
server/protocol/http/httpprot.cpp
server/protocol/http/pub/httpprot.h
server/protocol/http/Umakefil
helix-server-all-defines.pf

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

Unit Tests:
- N/A

Integration Tests:
- Tested primarily with curl, telnet and links :)

Leak Tests:
- N/A

Performance Tests:
- N/A

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


QA Hints
========
* N/A


Index: httpprot.h
===================================================================
RCS file: /cvsroot/server/protocol/http/pub/httpprot.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- httpprot.h	15 Dec 2009 03:38:13 -0000	1.33
+++ httpprot.h	30 Dec 2009 18:07:17 -0000	1.34
@@ -54,10 +54,18 @@
 class HTTP;
 class HTTPRange;
 class HTTPMobileCheck;
+#ifdef HELIX_FEATURE_SERVER_HTTP_ALLOW
+class HTTPAllow;
+enum OnURLState;
+#endif
 class M3U8Handler;
 
-class HTTPProtocol : public HTTPBaseProtocol,
-                     public IHXClientProfileManagerResponse
+class HTTPProtocol : public HTTPBaseProtocol
+                   , public IHXClientProfileManagerResponse
+#ifdef HELIX_FEATURE_SERVER_HTTP_ALLOW
+                   , public IHXPlayerConnectionResponse
+                   , public IHXPlayerController
+#endif
 {
 public:
     HTTPProtocol(void);
@@ -88,7 +96,29 @@
                                             IHXBuffer* pRequestURI,
                                             IHXValues* pRequestHeaders);
 
+#ifdef HELIX_FEATURE_SERVER_HTTP_ALLOW
+    // IHXPlayerConnectionResponse methods
+    STDMETHOD(OnConnectionDone)		(THIS_ HX_RESULT status);
+    STDMETHOD(OnURLDone)		(THIS_ HX_RESULT status);
+    STDMETHOD(OnBeginDone)		(THIS_ HX_RESULT status);
+    STDMETHOD(OnStopDone)		(THIS_ HX_RESULT status);
+    STDMETHOD(OnPauseDone)		(THIS_ HX_RESULT status);
 
+    // IHXPlayerController methods
+    STDMETHOD(Pause)		        (THIS);
+    STDMETHOD(Resume)                   (THIS);
+    STDMETHOD(Disconnect)               (THIS);
+    STDMETHOD(AlertAndDisconnect)       (THIS_ IHXBuffer* pAlert);
+    STDMETHOD(HostRedirect)             (THIS_ IHXBuffer* pHost, 
+					UINT16 nPort);
+    STDMETHOD(NetworkRedirect)          (THIS_ IHXBuffer* pURL,
+					UINT32 ulSecsFromNow);
+    STDMETHOD(Redirect)			(THIS_ IHXBuffer* pPartialURL);
+#endif
+
+    /************************************************************************
+     *  HTTPProt Methods
+     */
     BOOL                    statComplete(HX_RESULT status,
                                          UINT32 ulSize,
                                          UINT32 ulCreationTime,
@@ -121,6 +151,9 @@
     int                     handleMsg(HTTPMoveMessage* pMsg);
     int                     handleMsg(HTTPCopyMessage* pMsg);
 #endif
+#ifdef HELIX_FEATURE_SERVER_HTTP_ALLOW
+    HXBOOL                  UseAllowancePlugins(Client* pClient);
+#endif
     const char*             getErrorText(const char* pErrNo);
     HX_RESULT               AllowAccess(const char* pUrl);
 
@@ -174,7 +207,11 @@
 #endif
     UINT32                  m_ulByteRangeIndex;
     UINT32                  m_ulBytesSentPerRange;
-
+    HX_RESULT               m_allowanceStatus;
+#ifdef HELIX_FEATURE_SERVER_HTTP_ALLOW
+    HTTPAllow*              m_pHTTPAllow;
+    OnURLState              m_eOnURLState;
+#endif
 #ifdef HELIX_FEATURE_SERVER_MPEG2TS
     UINT32                  m_ulRegIndex;
     HXBOOL                  m_bFirstRequest;


_______________________________________________
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