am abaabb2c: Merge "Support other kinds of HTTP redirect in NuHTTPDataSource" into gingerbread

Merge commit 'abaabb2c7994e5a5026c2e2bd860d7f21eed0451' into gingerbread-plus-aosp

* commit 'abaabb2c7994e5a5026c2e2bd860d7f21eed0451':
  Support other kinds of HTTP redirect in NuHTTPDataSource
diff --git a/media/libstagefright/NuHTTPDataSource.cpp b/media/libstagefright/NuHTTPDataSource.cpp
index ab9285d..fcbfdac 100644
--- a/media/libstagefright/NuHTTPDataSource.cpp
+++ b/media/libstagefright/NuHTTPDataSource.cpp
@@ -96,6 +96,11 @@
     return connect(host, port, path, headers, offset);
 }
 
+static bool IsRedirectStatusCode(int httpStatus) {
+    return httpStatus == 301 || httpStatus == 302
+        || httpStatus == 303 || httpStatus == 307;
+}
+
 status_t NuHTTPDataSource::connect(
         const char *host, unsigned port, const char *path,
         const String8 &headers,
@@ -161,7 +166,7 @@
             return err;
         }
 
-        if (httpStatus == 302) {
+        if (IsRedirectStatusCode(httpStatus)) {
             string value;
             CHECK(mHTTP.find_header_value("Location", &value));