diff options
author | Andreas Huber <andih@google.com> | 2010-09-27 09:20:58 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-09-27 09:20:58 -0700 |
commit | 676570f3c6b41e8b854cb31e8ceaa370980eb6fc (patch) | |
tree | ba178c1b6db22f7ed836b00445a5ee3b33656d66 | |
parent | 0fa449cc475580d995e9d56756c3da5507d2b6f6 (diff) | |
parent | 7539a0594204c3436571bacabe50a14c78dedf5f (diff) | |
download | frameworks_av-676570f3c6b41e8b854cb31e8ceaa370980eb6fc.zip frameworks_av-676570f3c6b41e8b854cb31e8ceaa370980eb6fc.tar.gz frameworks_av-676570f3c6b41e8b854cb31e8ceaa370980eb6fc.tar.bz2 |
Merge "Support other kinds of HTTP redirect in NuHTTPDataSource" into gingerbread
-rw-r--r-- | media/libstagefright/NuHTTPDataSource.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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 @@ status_t NuHTTPDataSource::connect( 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 @@ status_t NuHTTPDataSource::connect( return err; } - if (httpStatus == 302) { + if (IsRedirectStatusCode(httpStatus)) { string value; CHECK(mHTTP.find_header_value("Location", &value)); |