Various I2P fixes and update to SAM3.1
This commit is contained in:
@ -193,7 +193,7 @@ private:
|
||||
|
||||
// send hello command
|
||||
m_state = read_hello_response;
|
||||
static const char cmd[] = "HELLO VERSION MIN=3.0 MAX=3.0\n";
|
||||
static const char cmd[] = "HELLO VERSION MIN=3.1 MAX=3.1\n";
|
||||
|
||||
ADD_OUTSTANDING_ASYNC("i2p_stream::start_read_line");
|
||||
async_write(m_sock, boost::asio::buffer(cmd, sizeof(cmd) - 1), wrap_allocator(
|
||||
@ -282,7 +282,7 @@ private:
|
||||
break;
|
||||
}
|
||||
|
||||
string_view remaining(m_buffer.data(), m_buffer.size());
|
||||
string_view remaining(m_buffer.data(), m_buffer.size() - 1);
|
||||
string_view token;
|
||||
|
||||
std::tie(token, remaining) = split_string(remaining, ' ');
|
||||
@ -432,8 +432,9 @@ private:
|
||||
TORRENT_ASSERT(m_magic == 0x1337);
|
||||
m_state = read_session_create_response;
|
||||
char cmd[400];
|
||||
int size = std::snprintf(cmd, sizeof(cmd), "SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT\n"
|
||||
, m_id);
|
||||
static const char options[] = "inbound.quantity=3 outbound.quantity=3 inbound.length=3 outbound.length=3";
|
||||
int size = std::snprintf(cmd, sizeof(cmd), "SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT SIGNATURE_TYPE=7 %s\n",
|
||||
m_id, options);
|
||||
ADD_OUTSTANDING_ASYNC("i2p_stream::start_read_line");
|
||||
async_write(m_sock, boost::asio::buffer(cmd, std::size_t(size)), wrap_allocator(
|
||||
[this](error_code const& ec, std::size_t, Handler hn) {
|
||||
|
@ -368,11 +368,11 @@ void http_connection::start(std::string const& hostname, int port
|
||||
}
|
||||
else
|
||||
#endif
|
||||
m_hostname = hostname;
|
||||
if (ps && ps->proxy_hostnames
|
||||
&& (ps->type == settings_pack::socks5
|
||||
|| ps->type == settings_pack::socks5_pw))
|
||||
{
|
||||
m_hostname = hostname;
|
||||
m_port = std::uint16_t(port);
|
||||
m_endpoints.emplace_back(address(), m_port);
|
||||
connect();
|
||||
@ -385,6 +385,7 @@ void http_connection::start(std::string const& hostname, int port
|
||||
, std::bind(&http_connection::on_resolve
|
||||
, me, _1, _2));
|
||||
}
|
||||
m_hostname = hostname;
|
||||
m_port = std::uint16_t(port);
|
||||
}
|
||||
}
|
||||
|
@ -3741,6 +3741,8 @@ namespace {
|
||||
if (m_peer_list->add_i2p_peer(dest, peer_info::tracker, {}, &st))
|
||||
state_updated();
|
||||
peers_erased(st.erased);
|
||||
|
||||
update_want_peers();
|
||||
}
|
||||
catch (...) { handle_exception(); }
|
||||
#endif
|
||||
|
@ -1746,7 +1746,11 @@ namespace {
|
||||
e.tier = std::uint8_t(tier);
|
||||
e.source = source;
|
||||
m_urls.push_back(e);
|
||||
|
||||
|
||||
#if TORRENT_USE_I2P
|
||||
if (is_i2p_url(e.url)) m_flags |= i2p;
|
||||
#endif
|
||||
|
||||
std::sort(m_urls.begin(), m_urls.end()
|
||||
, [] (announce_entry const& lhs, announce_entry const& rhs)
|
||||
{ return lhs.tier < rhs.tier; });
|
||||
|
Reference in New Issue
Block a user