mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
dns: query in udp when client requests in udp and no forwarder specified
This commit is contained in:
1 parent
8d20331096
commit
9acaff5b4a
4 files changed
+118
-72
No files matched your search
+2
-3
@@ -61,11 +61,10 @@ func (s *Server) ListenAndServeUDP() {
|
||||
log.F("[dns] not enough message data")
|
||||
continue
|
||||
}
|
||||
|
||||
binary.BigEndian.PutUint16(reqBytes[:2], reqLen)
|
||||
|
||||
go func() {
|
||||
respBytes, err := s.Client.Exchange(reqBytes[:2+n], caddr.String())
|
||||
respBytes, err := s.Client.Exchange(reqBytes[:2+n], caddr.String(), false)
|
||||
if err != nil {
|
||||
log.F("[dns] error in exchange: %s", err)
|
||||
return
|
||||
@@ -123,7 +122,7 @@ func (s *Server) ServeTCP(c net.Conn) {
|
||||
|
||||
binary.BigEndian.PutUint16(reqBytes[:2], reqLen)
|
||||
|
||||
respBytes, err := s.Exchange(reqBytes, c.RemoteAddr().String())
|
||||
respBytes, err := s.Exchange(reqBytes, c.RemoteAddr().String(), true)
|
||||
if err != nil {
|
||||
log.F("[dns]-tcp error in exchange: %s", err)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user