Re: http 307 temp redirect not working

Guillaume Tucker <[email protected]>
Newsgroups gmane.comp.multimedia.helix.devel
Message-ID <[email protected]>
Dear Henry,

I have corrected the HTTP status codes issues, adding default cases for 
2xx and 3xx values. I do not have write access to the source, but I 
thought you may want to apply the diff below. This has solved our 
redirection problem.

Best regards,
Guillaume.


===================================================================
RCS file: /cvsroot/filesystem/http/httpfsys.cpp,v
retrieving revision 1.128
diff -u -r1.128 httpfsys.cpp
--- httpfsys.cpp        6 Oct 2008 18:02:22 -0000       1.128
+++ httpfsys.cpp        17 Oct 2008 09:11:35 -0000
@@ -8491,6 +8491,7 @@

             HXLOGL1(HXLOG_HTTP, "HandleHeaderRead: HTTP header status 
==> %lu", ulHTTPStatus);

+
             if(pMessage->majorVersion() > 0)
             {
                 switch(ulHTTPStatus)
@@ -8524,7 +8525,8 @@
                         }
                         // No break, intentional fall-through

-                    case 200: // Success
+                    case 200:    // Success
+                    default_2xx: // Default success
                         {
                             if (m_bCheckingWhetherByteRangeWorks)
                             {
@@ -8570,8 +8572,19 @@
                             retVal = _HandleSuccess(pMessage, pBuffer, 
ulHeaderLength);
                         }
                         break;
-                    case 400: // Fail
-                    case 404: // Not Found
+
+                    case 301:
+                    case 302:
+                    case 307:
+                    default_3xx: // Default redirect
+                        {
+                            retVal = _HandleRedirect(pMessage);
+                        }
+                        break;
+
+                    case 400:    // Fail
+                    case 404:    // Not Found
+                    default_4xx: // Default failure
                         {
                             retVal = _HandleFail(ulHTTPStatus);
                         }
@@ -8582,13 +8595,6 @@
                             retVal = _HandleUnAuthorized(pMessage, 
pBuffer, ulHeaderLength);
                         }
                         break;
-                    case 301: // Redirect
-                    case 302: // Redirect
-                        {
-                            retVal = _HandleRedirect(pMessage);
-                        }
-                        break;
-
                     case 416: // Invalid range request
                         m_LastError = HXR_INVALID_PARAMETER;
                         m_pFileResponse->SeekDone(HXR_FAILED);
@@ -8597,7 +8603,18 @@

                     default:
                         {
-                            retVal = _HandleFail(400);
+                            // DLNA compliance
+                            // Any 2xx status codes not explicitly handled
+                            // must be treated as 200
+                            if ((ulHTTPStatus >= 200) && (ulHTTPStatus 
< 300))
+                              goto default_2xx;
+
+                            // Default 3xx code : redirect
+                            if ((ulHTTPStatus >= 300) && (ulHTTPStatus 
< 400))
+                              goto default_3xx;
+
+                            // Other code : failure
+                            goto default_4xx;
                         }
                         break;
                 };


_______________________________________________
Helix-client-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/helix-client-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.