mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-17 17:15:50 +00:00
@@ -169,22 +169,32 @@ class SSLHTTPDownloader_test : public beast::unit_test::suite
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
// bad hostname
|
// bad hostname
|
||||||
Downloader dl {env};
|
boost::system::error_code ec;
|
||||||
ripple::test::detail::FileDirGuard const datafile {
|
boost::asio::ip::tcp::resolver resolver {env.app().getIOService()};
|
||||||
*this, "downloads", "data", "", false, false};
|
auto const results = resolver.resolve("badhostname", "443", ec);
|
||||||
BEAST_EXPECT(dl->download(
|
// we require an error in resolving this name in order
|
||||||
"badhostname",
|
// for this test to pass. Some networks might have DNS hijacking
|
||||||
"443",
|
// that prevent NXDOMAIN, in which case the failure is not
|
||||||
"",
|
// possible, so we skip the test.
|
||||||
11,
|
if (ec)
|
||||||
datafile.file(),
|
{
|
||||||
std::function<void(boost::filesystem::path)> {std::ref(cb)}));
|
Downloader dl {env};
|
||||||
BEAST_EXPECT(cb.waitComplete());
|
ripple::test::detail::FileDirGuard const datafile {
|
||||||
BEAST_EXPECT(!boost::filesystem::exists(datafile.file()));
|
*this, "downloads", "data", "", false, false};
|
||||||
BEAST_EXPECTS(
|
BEAST_EXPECT(dl->download(
|
||||||
dl.sink_.messages().str().find("async_resolve")
|
"badhostname",
|
||||||
!= std::string::npos,
|
"443",
|
||||||
dl.sink_.messages().str());
|
"",
|
||||||
|
11,
|
||||||
|
datafile.file(),
|
||||||
|
std::function<void(boost::filesystem::path)> {std::ref(cb)}));
|
||||||
|
BEAST_EXPECT(cb.waitComplete());
|
||||||
|
BEAST_EXPECT(!boost::filesystem::exists(datafile.file()));
|
||||||
|
BEAST_EXPECTS(
|
||||||
|
dl.sink_.messages().str().find("async_resolve")
|
||||||
|
!= std::string::npos,
|
||||||
|
dl.sink_.messages().str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
// can't connect
|
// can't connect
|
||||||
|
|||||||
Reference in New Issue
Block a user