Skip to content

Commit

Permalink
fix hosts.txt loading bug
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Apr 13, 2014
1 parent 8694ed1 commit b0adb6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AddressBook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void AddressBook::LoadHostsFromI2P ()
content = i2p::util::http::httpRequest(url_ss.str());

// TODO: check http errors
if (! boost::starts_with(content, "<html>"))
if (! boost::starts_with(content, "<html>") && content.size() > 0)
break;
std::this_thread::sleep_for(std::chrono::seconds(5));
}
Expand Down
3 changes: 2 additions & 1 deletion util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,14 @@ namespace http

// code for parser tests
//{
// i2p::util::http::url u_0("http://127.0.0.1:7070/asdasd?qqqqqqqqqqqq");
// i2p::util::http::url u_1("http://user:password@site.com:8080/asdasd?qqqqqqqqqqqqq");
// i2p::util::http::url u_2("http://user:password@site.com/asdasd?qqqqqqqqqqqqqq");
// i2p::util::http::url u_3("http://user:@site.com/asdasd?qqqqqqqqqqqqq");
// i2p::util::http::url u_4("http://user@site.com/asdasd?qqqqqqqqqqqq");
// i2p::util::http::url u_5("http://@site.com:800/asdasd?qqqqqqqqqqqq");
// i2p::util::http::url u_6("http://@site.com:err_port/asdasd?qqqqqqqqqqqq");
// i2p::util::http::url u_7("http://user:password@site.com:err_port/asdasd?qqqqqqqqqqqq");
// i2p::util::http::url u_7("http://user:password@site.com:err_port/asdasd?qqqqqqqqqqqq");
//}
void url::parse(const std::string& url_s)
{
Expand Down

0 comments on commit b0adb6b

Please sign in to comment.