1
0
Fork 0
mirror of https://github.com/SamTherapy/dnscrypt.git synced 2024-12-22 08:50:43 +00:00

removed unnecessary todo

This commit is contained in:
Andrey Meshkov 2018-12-17 11:01:39 +03:00
parent 484a4dea74
commit 80e749d9e4

View file

@ -179,6 +179,9 @@ func (c *Client) ExchangeConn(m *dns.Msg, s *ServerInfo, conn net.Conn) (*dns.Ms
conn.Write(encryptedQuery)
encryptedResponse := make([]byte, maxDNSPacketSize)
// Reading the response
// In case if the server ServerInfo is not valid anymore (for instance, certificate was rotated) the read operation will most likely time out.
// This might be a signal to re-dial for the server certificate.
if c.Proto == "tcp" {
encryptedResponse, err = readPrefixed(conn)
if err != nil {
@ -194,7 +197,6 @@ func (c *Client) ExchangeConn(m *dns.Msg, s *ServerInfo, conn net.Conn) (*dns.Ms
decrypted, err := s.decrypt(encryptedResponse, clientNonce)
if err != nil {
// TODO: we should somehow distinguish this case as we might need to re-dial for the server certificate when it happens
return nil, 0, err
}