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

List:       helix-server-cvs
Subject:    [Server-cvs] engine/context server_stats.cpp,1.65,1.66
From:       juanitomoore () helixcommunity ! org
Date:       2011-10-27 17:18:04
[Download RAW message or body]

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

Modified Files:
	server_stats.cpp 
Log Message:
Synopsis:
=========
Deny an http request using and external authentication manager
in conjunction with the Session Manager and the Deny message
gets lost (goes nowhere).

Reviewer: Chytanya

Branches: HEAD

Bug id: 258389

Description
===========
Pass the message along instead of discarding it. Substitute the
message for the hard-coded error-number message if provided,
otherwise work as before using the standard errors ("Forbidden",
"File not found", etc.)

Note that the pAlert buffer is an optional parameter in the new
code, hence nothing needs to use it, but it's available should
one want to.

As far as storing the message in the stats, I followed the same
convention as storing the error code. Otherwise, we have calls
that accept pAlert, but do nothing with it. Although it's true
that nothing uses this yet, I added the Get method so it could.
Should the error message (pAlert) need to be put into an error
log or access log, this can now be done.

Files affected
===============
common/include/hxstats.h
protocol/http/pub/httpmsg.h
protocol/rtsp/rtspbase.cpp
protocol/rtsp/pub/rtspbase.h
server/engine/context/server_stats.cpp
server/engine/context/pub/server_stats.h
server/engine/core/core_proc.cpp
server/protocol/http/httpprot.cpp
server/protocol/http/servhttpmsg.cpp
server/protocol/http/pub/httpbaseproto.h
server/protocol/http/pub/httpprot.h
server/protocol/http/pub/servhttpmsg.h
server-restricted/protocol/http-ctrl/baseswitchhandler.cpp
server-restricted/protocol/http-ctrl/compatibility_handler.cpp
server-restricted/protocol/http-ctrl/httpcontentmgr.cpp
server-restricted/protocol/http-ctrl/pub/baseswitchhandler.h
server-restricted/protocol/http-ctrl/pub/compatibility_handler.h

Tested
======
Unit Tests: N/A
Integration Tests: Tested with a debug build, an external authentication
server set to Deny with a cute message and the Session manager. By
entering the URL on a web browser and adding fancy HTML in the External
Auth Deny message, we actually can see a complete web page instead of
the word "Forbidden".

Leak Tests: None
Performance Tests: N/A

Platforms Tested: linux-rhel5-x86_64
                  
Builds Tested: linux-rhel5-x86_64

QA hints
========
For testing http, try entering an asxgen URL from a web browser.


Index: server_stats.cpp
===================================================================
RCS file: /cvsroot/server/engine/context/server_stats.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- server_stats.cpp	2 Nov 2010 20:55:54 -0000	1.65
+++ server_stats.cpp	27 Oct 2011 17:18:01 -0000	1.66
@@ -97,6 +97,7 @@
 , m_bEndFlag(FALSE)
 , m_pOriginPlaylist(NULL)
 , m_pRange(NULL)
+, m_pAlert(NULL)
 {
 }
 
@@ -113,6 +114,7 @@
     SetStartTime(NULL);
     SetOriginPlaylist(NULL);
     SetRange(NULL);
+    SetAlert(NULL);
 }
 
 
@@ -264,9 +266,10 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 STDMETHODIMP
-ClipStats::SetStatus(UINT32 ulStatus)
+ClipStats::SetStatus(UINT32 ulStatus, IHXBuffer* pAlert)
 {
     m_ulStatus = ulStatus;
+    SetAlert(pAlert);
     return HXR_OK;
 }
 
@@ -776,6 +779,33 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
+// IHXClipStats::GetAlert()
+///////////////////////////////////////////////////////////////////////////////
+
+STDMETHODIMP_(IHXBuffer*)
+ClipStats::GetAlert()
+{
+    return m_pAlert;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// IHXClipStats::SetAlert()
+///////////////////////////////////////////////////////////////////////////////
+
+STDMETHODIMP
+ClipStats::SetAlert(IHXBuffer* pAlert)
+{
+    if (pAlert)
+    {
+        pAlert->AddRef();
+    }
+    IHXBuffer* pTemp = m_pAlert;
+    m_pAlert = pAlert;
+    HX_RELEASE(pTemp);
+    return HXR_OK;
+}
+
+///////////////////////////////////////////////////////////////////////////////
 // IHXClipStats2::GetOriginPlaylist()
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -929,6 +959,7 @@
     SetQoSApplicationAdaptationInfo(NULL);
     SetSessionControlId(NULL);
     SetClip(NULL);
+    SetAlert(NULL);
 
     // Don't use SetURL(NULL) here since this would schedule a callback and CA:
     IHXBuffer* pTemp = m_pURL;
@@ -1476,11 +1507,11 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 STDMETHODIMP
-SessionStats::SetStatus(UINT32 ulStatus)
+SessionStats::SetStatus(UINT32 ulStatus, IHXBuffer* pAlert)
 {
     if (m_pClip)
     {
-        m_pClip->SetStatus(ulStatus);
+        m_pClip->SetStatus(ulStatus, pAlert);
     }
     return HXR_OK;
 }
@@ -1967,6 +1998,30 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
+// IHXSessionStats::GetAlert()
+///////////////////////////////////////////////////////////////////////////////
+
+STDMETHODIMP_(IHXBuffer*)
+SessionStats::GetAlert()
+{
+    return (m_pClip) ? m_pClip->GetAlert() : 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// IHXSessionStats::SetAlert()
+///////////////////////////////////////////////////////////////////////////////
+
+STDMETHODIMP
+SessionStats::SetAlert(IHXBuffer* pAlert)
+{
+    if (m_pClip)
+    {
+        m_pClip->SetAlert(pAlert);
+    }
+    return HXR_OK;
+}
+
+///////////////////////////////////////////////////////////////////////////////
 //  IHXSessionStats4::GetSwitchCount()
 ///////////////////////////////////////////////////////////////////////////////
 


_______________________________________________
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