OLD | NEW |
(Empty) | |
| 1 // 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 |
| 7 using std::deque; |
| 8 using std::string; |
| 9 |
| 10 namespace chromeos_update_engine { |
| 11 |
| 12 void 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. |
| 20 void 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 |
OLD | NEW |