[netperf-dev] netperf2 commit notice r306 - trunk/src

raj at netperf.org raj at netperf.org
Mon Jun 22 11:31:45 PDT 2009


Author: raj
Date: 2009-06-22 11:31:43 -0700 (Mon, 22 Jun 2009)
New Revision: 306

Modified:
   trunk/src/nettest_bsd.c
Log:
do not get caught in a loop if the client bails on us early in a TCP_CRR test

Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c	2009-06-22 17:58:37 UTC (rev 305)
+++ trunk/src/nettest_bsd.c	2009-06-22 18:31:43 UTC (rev 306)
@@ -9581,10 +9581,17 @@
 	send_response();
 	exit(1);
       }
-      else {
+      else if (request_bytes_recvd > 0) {
 	request_bytes_remaining -= request_bytes_recvd;
 	temp_message_ptr  += request_bytes_recvd;
       }
+      else {
+      	/* for some reason the remote closed the connection on
+	 * us and that is unexpected so we should just close the 
+	 * socket and move-on. for that we will use an evil goto
+	 * neener neener raj 20090622 */
+    	goto bail;
+      }
     }
     
     if (timed_out) {
@@ -9636,8 +9643,10 @@
 	 recv_message_ptr,
 	 1,
 	 0);
+bail:
     close(s_data);
 #else
+bail:
     close(s_data);
 #endif /* TCP_CRR_SHUTDOWN */
 
@@ -12987,9 +12996,5 @@
     else if (strstr(test_name,"MAERTS")) {
       send_size = -1;
     }
-    else {
-      printf("No default port known for the %s test, please set one yourself\n",test_name);
-      exit(-1);
-    }
   }
 }



More information about the netperf-dev mailing list