diff options
author | Spider Boardman <spider@orb.nashua.nh.us> | 1996-10-10 01:09:59 -0400 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-10-10 01:09:59 -0400 |
commit | d68313686b00130959e29729f02f2ba301a9e146 (patch) | |
tree | e11e61b28a7775f687289c18e2f82a1981ca6955 /t/lib | |
parent | b454f38bd33ec8453eb76b648a8dd43748c64954 (diff) | |
download | perl-d68313686b00130959e29729f02f2ba301a9e146.tar.gz |
Re: 5.003_06 is available (results on ULTRIX)
fix t/lib/socket.t to treat TCP like the stream protocol it is
rather than expecting it behave rationally in all cases.
Diffstat (limited to 't/lib')
-rwxr-xr-x | t/lib/socket.t | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/lib/socket.t b/t/lib/socket.t index 1e1027e081..4e382958ce 100755 --- a/t/lib/socket.t +++ b/t/lib/socket.t @@ -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 { |