Re: 5.003_06 is available (results on ULTRIX)
authorSpider Boardman <spider@orb.nashua.nh.us>
Thu, 10 Oct 1996 05:09:59 +0000 (01:09 -0400)
committerAndy Dougherty <doughera@lafcol.lafayette.edu>
Thu, 10 Oct 1996 05:09:59 +0000 (01:09 -0400)
fix t/lib/socket.t to treat TCP like the stream protocol it is
rather than expecting it behave rationally in all cases.

t/lib/socket.t

index 1e1027e..4e38295 100755 (executable)
@@ -26,6 +26,10 @@ if (socket(T,PF_INET,SOCK_STREAM,6)) {
 
        syswrite(T,"hello",5);
        $read = sysread(T,$buff,10);    # Connection may be granted, then closed!
+       while ($read > 0 && length($buff) < 5) {
+           # adjust for fact that TCP doesn't guarantee size of reads/writes
+           $read = sysread(T,$buff,10,length($buff));
+       }
        print(($read == 0 || $buff eq "hello") ? "ok 3\n" : "not ok 3\n");
   }
   else {
@@ -52,6 +56,10 @@ if( socket(S,PF_INET,SOCK_STREAM,6) ){
 
        syswrite(S,"olleh",5);
        $read = sysread(S,$buff,10);    # Connection may be granted, then closed!
+       while ($read > 0 && length($buff) < 5) {
+           # adjust for fact that TCP doesn't guarantee size of reads/writes
+           $read = sysread(S,$buff,10,length($buff));
+       }
        print(($read == 0 || $buff eq "olleh") ? "ok 6\n" : "not ok 6\n");
   }
   else {