shill: Enable and disable reverse-path filtering
When an http proxy request is active (as well as portal check, when
that gets written), we need to initiate connections over a non-default
network interface. For this we temporarily disable reverse-path
filtering on the interface during the duration of the request.
BUG=chromium-os:24141
TEST=New unit tests for HTTPProxy and Connection
Change-Id: Ife2ad775fd8a3d2fb48f860e804eeb442dc5c58a
Reviewed-on: https://gerrit.chromium.org/gerrit/12889
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/http_proxy.h b/http_proxy.h
index 6bc0601..3b9c334 100644
--- a/http_proxy.h
+++ b/http_proxy.h
@@ -50,8 +50,7 @@
kStateFlushResponse,
};
- HTTPProxy(const std::string &interface_name,
- const std::vector<std::string> &dns_servers);
+ explicit HTTPProxy(ConnectionRefPtr connection);
virtual ~HTTPProxy();
// Start HTTP proxy.
@@ -111,8 +110,7 @@
// State held for the lifetime of the proxy.
State state_;
- const std::string interface_name_;
- std::vector<std::string> dns_servers_;
+ ConnectionRefPtr connection_;
scoped_ptr<Callback1<int>::Type> accept_callback_;
scoped_ptr<Callback2<bool, int>::Type> connect_completion_callback_;
scoped_ptr<Callback1<bool>::Type> dns_client_callback_;
@@ -136,6 +134,7 @@
std::string client_version_;
int server_port_;
int server_socket_;
+ bool is_route_requested_;
CancelableTask *idle_timeout_;
std::vector<std::string> client_headers_;
std::string server_hostname_;