Sending your ip as part of peer_connection.rs

This commit is contained in:
Igor Katson 2024-08-31 11:35:26 +01:00
parent e9acbaa9dc
commit 3f014ee80a
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 17 additions and 12 deletions

View file

@ -68,10 +68,7 @@ use librqbit_core::{
use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard};
use peer_binary_protocol::{
extended::{
handshake::{ExtendedHandshake, YourIP},
ut_metadata::UtMetadata,
ut_pex::UtPex,
ExtendedMessage,
handshake::ExtendedHandshake, ut_metadata::UtMetadata, ut_pex::UtPex, ExtendedMessage,
},
Handshake, Message, MessageOwned, Piece, Request,
};
@ -948,8 +945,6 @@ impl<'a> PeerConnectionHandler for &'a PeerHandler {
&self,
handshake: &mut ExtendedHandshake<ByteBuf>,
) -> anyhow::Result<()> {
let your_ip = self.addr.ip();
handshake.yourip = Some(YourIP(your_ip));
let info_bytes = &self.state.torrent().info_bytes;
if !info_bytes.is_empty() {
if let Ok(len) = info_bytes.len().try_into() {