http_connection now supports connecting to all IPs a hostname resolves to, as fallbacks

This commit is contained in:
Arvid Norberg
2008-05-18 22:14:55 +00:00
parent 282f30c7e7
commit c5d61667b3
3 changed files with 64 additions and 36 deletions

View File

@@ -76,7 +76,7 @@ void run_test(std::string const& url, int size, int status, int connected
boost::shared_ptr<http_connection> h(new http_connection(ios, cq
, &::http_handler, true, &::http_connect_handler));
h->get(url, seconds(30), 0, &ps);
h->get(url, seconds(5), 0, &ps);
ios.reset();
ios.run();
@@ -104,6 +104,9 @@ void run_suite(std::string const& protocol, proxy_settings const& ps)
<< " proxy **********************\n" << std::endl;
typedef boost::optional<error_code> err;
// this requires the hosts file to be modified
// run_test(protocol + "://test.dns.ts:8001/test_file", 3216, 200, 1, error_code(), ps);
run_test(protocol + "://127.0.0.1:8001/relative/redirect", 3216, 200, 2, error_code(), ps);
run_test(protocol + "://127.0.0.1:8001/redirect", 3216, 200, 2, error_code(), ps);
run_test(protocol + "://127.0.0.1:8001/infinite_redirect", 0, 301, 6, error_code(), ps);