mirror of
https://github.com/DNSCrypt/doh-server.git
synced 2025-04-03 04:57:37 +03:00
Improve clarity
This commit is contained in:
parent
a2221f9d27
commit
2f225c3810
1 changed files with 3 additions and 3 deletions
|
@ -130,7 +130,7 @@ impl DoH {
|
|||
|
||||
fn proxy(&self, query: Vec<u8>) -> Box<Future<Item = Response, Error = ()>> {
|
||||
let socket = UdpSocket::bind(&self.local_bind_address).unwrap();
|
||||
let server_address_inner = self.server_address;
|
||||
let expected_server_address = self.server_address;
|
||||
let fut = socket
|
||||
.send_dgram(query, &self.server_address)
|
||||
.map_err(|_| ())
|
||||
|
@ -138,8 +138,8 @@ impl DoH {
|
|||
let packet = vec![0; MAX_DNS_RESPONSE_LEN];
|
||||
socket.recv_dgram(packet).map_err(|_| {})
|
||||
})
|
||||
.and_then(move |(_socket, mut packet, len, server_address)| {
|
||||
if len < MIN_DNS_PACKET_LEN || server_address_inner != server_address {
|
||||
.and_then(move |(_socket, mut packet, len, response_server_address)| {
|
||||
if len < MIN_DNS_PACKET_LEN || expected_server_address != response_server_address {
|
||||
return future::err(());
|
||||
}
|
||||
packet.truncate(len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue