[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-filesystem-cvs
Subject: [Filesystem-cvs] http httpfsys.cpp,1.134.4.1,1.134.4.2
From: demiurgo () helixcommunity ! org
Date: 2009-10-23 15:06:39
Message-ID: 200910231617.n9NGHV8S019081 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/filesystem/http
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv13764
Modified Files:
Tag: hxclient_4_2_0_brizo
httpfsys.cpp
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement with \
Real Networks, and I am authorized to contribute this code under said agreement."
Modified by: ext-jesus.1.rodriguez@nokia.com
Reviewed by:
Date: Sep 30, 2009
Project: SymbianMmf_wm
ErrorId: LJLI-7W6AH3
Synopsis: Helix doesn't report "service full" event when a shoutcast server reaches \
max user count.
Overview:
When a Shoutcast server cannot service any further connections, it returns status \
"ICY 400 Service Full". Helix does not act accordingly and hangs waiting for data to \
play.
Solution:
CHTTPFileObject::HandleHeaderRead detects whether an HTTP request has been answered \
with an ICY response, but it assumes said answer to be successful (200 OK). This fix \
adds some logic to check the status code of the ICY response, map it to an HTTP \
status code and abort via CHTTPFileObject::_HandleFail, if applicable.
In the particular case of "ICY 400 Service Full" and "ICY 401 Service Unavailable", \
the most appropriate HTTP code is "503 Service Unavailable", which maps to \
HXR_PE_SERVICE_UNAVAILABLE; this will be mapped on Symbian to KErrServerBusy instead \
of KErrMMInvalidProtocol, in order to return a more precise code to any client of the \
Helix API.
Modified files:
/filesystem/http/httpfsys.cpp
/clientapps/symbianMmf/common/hxmmfbasectrl.cpp
New files: None
Image size and heap use impact: Negligible
Module Release testing (STIF): Passed
Test case(s) added: None
Memory leak check performed: Yes, no new leaks introduced.
Platforms and Profiles Build verified: helix-client-s60-50-mmf-mdf-arm
Platforms and Profiles Functionality verified: armv5
Branch: 223Cays, 210Cays, 310Atlas, 401Brizo, HEAD
Index: httpfsys.cpp
===================================================================
RCS file: /cvsroot/filesystem/http/httpfsys.cpp,v
retrieving revision 1.134.4.1
retrieving revision 1.134.4.2
diff -u -d -r1.134.4.1 -r1.134.4.2
--- httpfsys.cpp 9 Oct 2009 19:17:43 -0000 1.134.4.1
+++ httpfsys.cpp 23 Oct 2009 15:06:37 -0000 1.134.4.2
@@ -5444,6 +5444,14 @@
ReportGeneralFailure();
}
}
+ else if (ulHTTPError == 503)
+ {
+ theErr = HXR_PE_SERVICE_UNAVAILABLE;
+ if (m_bOnServer)
+ {
+ ReportGeneralFailure();
+ }
+ }
else
{
theErr = HXR_DOC_MISSING;
@@ -8329,6 +8337,8 @@
retVal = pBuffer->SetSize(ulLength + m_ulLastHeaderSize);
szHeader = (char*) pBuffer->GetBuffer();
+ HXLOGL4(HXLOG_HTTP, "CHTTPFileObject::HandleHeaderRead received %s", \
(const char*)szHeader); +
if (SUCCEEDED(retVal))
{
// Move New Data to make room for insertion of previous header data
@@ -8374,7 +8384,7 @@
}
// The Darwin server streams mp3 using ShoutCast (or at least they
- // they use the ShoutCast mechanism for including meta data in
+ // use the ShoutCast mechanism for including meta data in
// the mp3 stream). So, check the header for "icy-metaint", and
// enable ShoutCast mode.
@@ -8386,6 +8396,27 @@
{
m_bShoutcast = TRUE;
m_ulMinStartupLengthNeeded = \
HTTP_NONSTANDARD_MIN_STARTUP_LENGTH_NEEDED; +
+ UINT32 statusCode = atoi(szHeader+3); // Skip the ICY declaration \
and get the status code. + if(statusCode >= 400)
+ {
+ switch(statusCode)
+ {
+ // Aside from 200 OK, ICY status codes do not match HTTP \
codes + // e.g. there are some ICY 4xx codes that are \
server-side errors + // and should be mapped to HTTP 5xx.
+ case 400: // Service Full
+ case 401: // Service Unavailable
+ statusCode = 503;
+ break;
+ default:
+ statusCode = 400;
+ break;
+ }
+ HXLOGL1(HXLOG_HTTP, "CHTTPFileObject::HandleHeaderRead ICY \
failed with status %u", statusCode); + retVal = \
_HandleFail(statusCode); + goto cleanup;
+ }
}
else
{
_______________________________________________
Filesystem-cvs mailing list
Filesystem-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/filesystem-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic