[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-server-cvs
Subject: [Server-cvs] protocol/http httpprot.cpp,1.112.2.5,1.112.2.6
From: svaidhya () helixcommunity ! org
Date: 2011-02-16 19:08:16
Message-ID: 201102161908.p1GJ86bF018717 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/server/protocol/http
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv7877
Modified Files:
Tag: SERVER_14_2
httpprot.cpp
Log Message:
Synopsis
=======
Fix for Bug 269349: Unable to play secure urls with RedirectRequests disabled
Branches: HEAD, 14.2
Reviewer: Chytanya
Description
=========
The M3U8Handler is responsible for appending any QP present in the request, to each \
of the individual ts requests. It also takes care of Bookmarking.
When redirection is disabled the M3U8handler was not appending the QPs to .ts segment \
requests. Hence the DAUC plugin got ts requests w/o the parameters required for \
validation and therefore fails with "Not Authorized".
Reason why m3u8handler fails to append QP to .ts requests:
For validating bookmarking requests we open the m3u8 file on disk and check last \
segment created. When redirection is Enabled, the M3U8Handler gets "m3u8 request", it \
computes m3u8 path and validates. When redirection is Disabled, the M3U8Handler gets \
"m3ugen request". It doesnot have the details to compute the m3u8 path from m3ugen \
request and hence fails to append any QP
Fix:
When redirection is Disabled, the m3ugen needs to somehow notify the m3u8 path to \
M3U8handler. This is done by adding it ro response headers sent to HTTPProtocol which \
then passes it to M3U8Handler. HTTPProtocol needs to take care of not sending this \
header in the response message to client.
Also, in HTTPProtocol, the IsM3ugenReq() method was not considering the uber m3u8 \
requests as m3ugen requests when redirection is disabled. This problem showed up \
while testing Bookmarking with Redirection Disabled. Fixed it.
Files Affected
===========
./server/protocol/http/httpprot.cpp
./server-restricted/protocol/http/m3u8hdlr.cpp
./server-restricted/protocol/http/pub/m3u8hdlr.h
./server_rn/appext/m3ugen/m3ugenfsys.cpp
Testing Performed
==============
Unit Tests:
- None
Integration Tests:
- Verified Bookmarking
1. Single rate Bookmarking
2. MR Bookmanrking
3. Live with QP
4. Invalid BM start parameters
- All above were verified with Redirection OFF and ON
- With DAUC verified SR and MR m3ugen requests could be played successfully
with and w/o redirection
- With DAUC verified SR and MR .m3u8 requests could be played successfully
Leak Tests:
- None
Performance Tests:
- None
Build verified: sunos-5.10-sparc64, linux-rhel5-x86
Platform tested : sunos-5.10-sparc64, linux-rhel5-x86
Index: httpprot.cpp
===================================================================
RCS file: /cvsroot/server/protocol/http/httpprot.cpp,v
retrieving revision 1.112.2.5
retrieving revision 1.112.2.6
diff -u -d -r1.112.2.5 -r1.112.2.6
--- httpprot.cpp 4 Feb 2011 03:46:36 -0000 1.112.2.5
+++ httpprot.cpp 16 Feb 2011 19:08:13 -0000 1.112.2.6
@@ -1414,6 +1414,8 @@
m_bKeepAlive = FALSE;
+ HXBOOL bAddToMsg = TRUE;
+
result = pResponseHeaders->GetFirstPropertyCString(pName, pValue);
while (result == HXR_OK)
@@ -1435,12 +1437,19 @@
SetMimeTypeInRegistry((const char*)pValue->GetBuffer());
}
}
+ else if (strcasecmp(pName, "M3U8BasePath") == 0)
+ {
+ //Dont add this. Just used for communicating m3u8 filename to \
HTTP protocol + bAddToMsg = FALSE;
+ }
- pMimeHeader = new MIMEHeader(pName);
- pMimeHeader->addHeaderValue((const char*)pValue->GetBuffer());
- pMsg->addHeader(pMimeHeader);
+ if (bAddToMsg)
+ {
+ pMimeHeader = new MIMEHeader(pName);
+ pMimeHeader->addHeaderValue((const char*)pValue->GetBuffer());
+ pMsg->addHeader(pMimeHeader);
+ }
pValue->Release();
-
result = pResponseHeaders->GetNextPropertyCString(pName,
pValue);
}
@@ -2378,35 +2387,35 @@
}
HXBOOL bIPhoneReq = FALSE;
- INT32 iRedirect = 1;
- pClient->m_pProc->pc->registry->GetInt("Config.MPEG2_Transport_Stream.RedirectRequests",
- &iRedirect, \
pClient->m_pProc);
-
- if ((HXBOOL)iRedirect)
+ //If extension is m3u8 it is a m3ugen req weather or not redirection is ON
+ if (m_fileExt == "m3u8")
{
- if (m_fileExt == "m3u8")
- {
- bIPhoneReq = TRUE;
- }
+ bIPhoneReq = TRUE;
}
else
{
- HX_ASSERT(m_pRequest);
- const char* pURL = NULL;
- m_pRequest->GetURL(pURL);
+ INT32 iRedirect = 1;
+ pClient->m_pProc->pc->registry->GetInt("Config.MPEG2_Transport_Stream.RedirectRequests",
+ &iRedirect, \
pClient->m_pProc);
- char* pM3ugenMP = pClient->m_pProc->pc->m3ugen_moutpoint;
- if (strncasecmp(pURL, pM3ugenMP, strlen(pM3ugenMP)) == 0)
+ if (!((HXBOOL)iRedirect))
{
- bIPhoneReq = TRUE;
+ HX_ASSERT(m_pRequest);
+ const char* pURL = NULL;
+ m_pRequest->GetURL(pURL);
+
+ char* pM3ugenMP = pClient->m_pProc->pc->m3ugen_moutpoint;
+ if (strncasecmp(pURL, pM3ugenMP, strlen(pM3ugenMP)) == 0)
+ {
+ bIPhoneReq = TRUE;
+ }
}
}
return bIPhoneReq;
}
-
HX_RESULT
HTTPProtocol::AllowAccess(const char* pUrl)
{
@@ -3058,7 +3067,7 @@
if (pos + 1 != (INT32)strlen(m_pURL)) //only if there are QP after ?
{
m_pM3U8Hdlr = new M3U8Handler(m_pDemux->GetClient()->m_pProc,
- m_pURL, pos, m_pRequestHeaders);
+ m_pURL, pos, m_pRequest);
if (m_pM3U8Hdlr->m_bError)
{
HX_DELETE(m_pM3U8Hdlr);
_______________________________________________
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