minor changes

This commit is contained in:
ssrlive 2023-08-05 22:32:57 +08:00
parent 1031f586f7
commit 4ebd019cb5

View file

@ -33,8 +33,6 @@ struct SocksProxyImpl {
data_buf: VecDeque<u8>, data_buf: VecDeque<u8>,
version: Version, version: Version,
credentials: Option<UserKey>, credentials: Option<UserKey>,
command: protocol::Command,
udp_relay_addr: Option<Address>,
} }
impl SocksProxyImpl { impl SocksProxyImpl {
@ -53,8 +51,6 @@ impl SocksProxyImpl {
data_buf: VecDeque::default(), data_buf: VecDeque::default(),
version, version,
credentials, credentials,
command: protocol::Command::Connect,
udp_relay_addr: None,
}; };
result.send_client_hello()?; result.send_client_hello()?;
Ok(result) Ok(result)
@ -221,11 +217,6 @@ impl SocksProxyImpl {
return Err(format!("SOCKS connection failed: {}", response.reply).into()); return Err(format!("SOCKS connection failed: {}", response.reply).into());
} }
if self.command == protocol::Command::UdpAssociate {
log::info!("UDP packet destination: {}", response.address);
self.udp_relay_addr = Some(response.address);
}
self.server_outbuf.append(&mut self.data_buf); self.server_outbuf.append(&mut self.data_buf);
self.data_buf.clear(); self.data_buf.clear();