blob: 5d006607c6e3697fc29db2edefe867581d9803bd [file] [log] [blame]
Andrew de los Reyes45168102010-11-22 11:13:50 -08001// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "update_engine/http_fetcher.h"
6
7using std::deque;
8using std::string;
9
10namespace chromeos_update_engine {
11
12void HttpFetcher::SetPostData(const void* data, size_t size) {
13 post_data_set_ = true;
14 post_data_.clear();
15 const char *char_data = reinterpret_cast<const char*>(data);
16 post_data_.insert(post_data_.end(), char_data, char_data + size);
17}
18
19// Proxy methods to set the proxies, then to pop them off.
20void HttpFetcher::ResolveProxiesForUrl(const string& url) {
21 if (!proxy_resolver_) {
22 LOG(INFO) << "Not resolving proxies (no proxy resolver).";
23 return;
24 }
25 deque<string> proxies;
26 if (proxy_resolver_->GetProxiesForUrl(url, &proxies)) {
27 SetProxies(proxies);
28 }
29}
30
31} // namespace chromeos_update_engine