mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
support boost 1.87
This commit is contained in:
parent
3474538697
commit
ffd18baf30
28 changed files with 164 additions and 172 deletions
|
@ -562,11 +562,10 @@ namespace data
|
|||
if(proxyUrl.schema.size())
|
||||
{
|
||||
// proxy connection
|
||||
auto it = boost::asio::ip::tcp::resolver(service).resolve (
|
||||
boost::asio::ip::tcp::resolver::query (proxyUrl.host, std::to_string(proxyUrl.port)), ecode);
|
||||
auto it = boost::asio::ip::tcp::resolver(service).resolve (proxyUrl.host, std::to_string(proxyUrl.port), ecode);
|
||||
if(!ecode)
|
||||
{
|
||||
s.lowest_layer().connect(*it, ecode);
|
||||
s.lowest_layer().connect(*it.begin (), ecode);
|
||||
if(!ecode)
|
||||
{
|
||||
auto & sock = s.next_layer();
|
||||
|
@ -599,7 +598,7 @@ namespace data
|
|||
LogPrint(eLogError, "Reseed: HTTP CONNECT read error: ", ecode.message());
|
||||
return "";
|
||||
}
|
||||
if(proxyRes.parse(boost::asio::buffer_cast<const char *>(readbuf.data()), readbuf.size()) <= 0)
|
||||
if(proxyRes.parse(std::string {boost::asio::buffers_begin(readbuf.data ()), boost::asio::buffers_begin(readbuf.data ()) + readbuf.size ()}) <= 0)
|
||||
{
|
||||
sock.close();
|
||||
LogPrint(eLogError, "Reseed: HTTP CONNECT malformed reply");
|
||||
|
@ -638,13 +637,11 @@ namespace data
|
|||
else
|
||||
{
|
||||
// direct connection
|
||||
auto it = boost::asio::ip::tcp::resolver(service).resolve (
|
||||
boost::asio::ip::tcp::resolver::query (url.host, std::to_string(url.port)), ecode);
|
||||
auto endpoints = boost::asio::ip::tcp::resolver(service).resolve (url.host, std::to_string(url.port), ecode);
|
||||
if (!ecode)
|
||||
{
|
||||
bool connected = false;
|
||||
boost::asio::ip::tcp::resolver::iterator end;
|
||||
while (it != end)
|
||||
for (auto it = endpoints.begin (); it != endpoints.end ();)
|
||||
{
|
||||
boost::asio::ip::tcp::endpoint ep = *it;
|
||||
bool supported = false;
|
||||
|
@ -749,14 +746,11 @@ namespace data
|
|||
boost::asio::io_context service;
|
||||
boost::asio::ip::tcp::socket s(service, boost::asio::ip::tcp::v6());
|
||||
|
||||
auto it = boost::asio::ip::tcp::resolver(service).resolve (
|
||||
boost::asio::ip::tcp::resolver::query (url.host, std::to_string(url.port)), ecode);
|
||||
|
||||
auto endpoints = boost::asio::ip::tcp::resolver(service).resolve (url.host, std::to_string(url.port), ecode);
|
||||
if (!ecode)
|
||||
{
|
||||
bool connected = false;
|
||||
boost::asio::ip::tcp::resolver::iterator end;
|
||||
while (it != end)
|
||||
for (auto it = endpoints.begin (); it != endpoints.end ();)
|
||||
{
|
||||
boost::asio::ip::tcp::endpoint ep = *it;
|
||||
if (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue