AU: Support redirects.

BUG=5692
TEST=unit tests, gmerged on device, making sure update engine still works

Change-Id: If593f6efbd39452aa98b453f4d5489ce7d7d7fb9

Review URL: http://codereview.chromium.org/3161041
diff --git a/libcurl_http_fetcher.cc b/libcurl_http_fetcher.cc
index f636764..a07a825 100644
--- a/libcurl_http_fetcher.cc
+++ b/libcurl_http_fetcher.cc
@@ -61,6 +61,13 @@
   CHECK_EQ(curl_easy_setopt(curl_handle_, CURLOPT_LOW_SPEED_TIME, 3 * 60),
            CURLE_OK);
 
+  // By default, libcurl doesn't follow redirections. Allow up to
+  // |kMaxRedirects| redirections.
+  CHECK_EQ(curl_easy_setopt(curl_handle_, CURLOPT_FOLLOWLOCATION, 1),
+           CURLE_OK);
+  CHECK_EQ(curl_easy_setopt(curl_handle_, CURLOPT_MAXREDIRS, kMaxRedirects),
+           CURLE_OK);
+
   CHECK_EQ(curl_multi_add_handle(curl_multi_handle_, curl_handle_), CURLM_OK);
   transfer_in_progress_ = true;
 }