]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup for Andreas: TCP receives should never be retried
authorMichael Graff <mgraff@isc.org>
Fri, 8 Sep 2000 22:09:13 +0000 (22:09 +0000)
committerMichael Graff <mgraff@isc.org>
Fri, 8 Sep 2000 22:09:13 +0000 (22:09 +0000)
lib/dns/dispatch.c

index 009947bd1546dc24b2ebdfb90d4a56595266e5db..92b3e5bb29a7ba01e60af7c1f856184af8d2286a 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: dispatch.c,v 1.57.2.2 2000/09/02 00:00:13 bwelling Exp $ */
+/* $Id: dispatch.c,v 1.57.2.3 2000/09/08 22:09:13 explorer Exp $ */
 
 #include <config.h>
 
@@ -640,11 +640,8 @@ udp_recv(isc_task_t *task, isc_event_t *ev_in) {
 /*
  * General flow:
  *
- * If I/O result == CANCELED, free the buffer and notify everyone as
- * the various queues drain.
- *
- * If I/O is error (not canceled and not success) log it, free the buffer,
- * and restart.
+ * If I/O result == CANCELED, EOF, or error, free the buffer
+ * and notify everyone as the various queues drain.
  *
  * If query:
  *     if no listeners: free the buffer, restart.
@@ -697,18 +694,29 @@ tcp_recv(isc_task_t *task, isc_event_t *ev_in) {
                tcpmsg->result = ISC_R_CANCELED;
        }
 
-       switch (tcpmsg->result) {
-       case ISC_R_SUCCESS:
-               break;
+       if (tcpmsg->result != ISC_R_SUCCESS) {
+               switch (tcpmsg->result) {
+               case ISC_R_CANCELED:
+                       break;
+                       
+               case ISC_R_EOF:
+                       dispatch_log(disp, LVL(90), "shutting down on EOF");
+                       disp->shutdown_why = ISC_R_EOF;
+                       disp->shutting_down = 1;
+                       do_cancel(disp, NULL);
+                       break;
 
-       case ISC_R_EOF:
-               dispatch_log(disp, LVL(90), "shutting down on EOF");
-               disp->shutdown_why = ISC_R_EOF;
-               disp->shutting_down = 1;
-               do_cancel(disp, NULL);
-               /* FALLTHROUGH */
+               default:
+                       dispatch_log(disp, ISC_LOG_ERROR,
+                                    "shutting down due to TCP "
+                                    "receive error: %s",
+                                    isc_result_totext(tcpmsg->result));
+                       disp->shutdown_why = ISC_R_EOF;
+                       disp->shutting_down = 1;
+                       do_cancel(disp, NULL);
+                       break;
+               }
 
-       case ISC_R_CANCELED:
                /*
                 * The event is statically allocated in the tcpmsg      
                 * structure, and destroy_disp() frees the tcpmsg, so we must
@@ -730,15 +738,7 @@ tcp_recv(isc_task_t *task, isc_event_t *ev_in) {
                        if (killit)
                                destroy_mgr(&mgr);
                }
-
                return;
-
-       default:
-               /*
-                * otherwise, on strange error, log it and restart.
-                * XXXMLG
-                */
-               goto restart;
        }
 
        dispatch_log(disp, LVL(90), "result %d, length == %d, addr = %p",