Browse Source

Partial fix: prevents infinite loop if client closes connection.
Full fix needs to be to do partial reads on TCP connections.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1540 e5f2f494-b856-4b98-b285-d166d9295462

Shane Kerr 15 years ago
parent
commit
0badd8fdac
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/bin/auth/main.cc

+ 7 - 0
src/bin/auth/main.cc

@@ -516,8 +516,15 @@ processMessageTCP(const int fd, Message& dns_message,
         if (cc0 < 0) {
             if (verbose_mode) {
                 cerr << "TCP receive error" << endl;
+                close(ts);
+                return;
             }
         }
+        if (cc0 == 0) {
+            // client closed connection
+            close(ts);
+            return;
+        }
         cc += cc0;
     }