]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/nntpd.t: simplify condition for response termination
authorEric Wong <e@80x24.org>
Wed, 30 Sep 2015 21:00:26 +0000 (21:00 +0000)
committerEric Wong <e@80x24.org>
Wed, 30 Sep 2015 21:09:24 +0000 (21:09 +0000)
Multiline responses must end with "\r\n.\r\n", so we won't
break out early in case the OS doesn't support MSG_MORE.

t/nntpd.t

index e4c0244d461cbe2ce35a50e28faad23d9038dd16..8a721e2098eb5556a8022fa1f22d4b3afb2304cb 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -130,7 +130,7 @@ EOF
                syswrite($s, "HDR $k $mid\r\n");
                do {
                        sysread($s, $buf, 4096, length($buf));
-               } until ($buf =~ /^[^2]../ || $buf =~ /\r\n\.\r\n\z/);
+               } until ($buf =~ /\r\n\.\r\n\z/);
                my @r = split("\r\n", $buf);
                like($r[0], qr/\A224 /, '224 response for HDR');
                is($r[1], "0 $v", 'got expected response for HDR');
@@ -167,7 +167,7 @@ EOF
                $buf = '';
                do {
                        sysread($s, $buf, 4096, length($buf));
-               } until ($buf =~ /^[^2]../ || $buf =~ /\r\n\.\r\n\z/);
+               } until ($buf =~ /\r\n\.\r\n\z/);
                my @r = split("\r\n", $buf);
                like($r[0], qr/^224 /, 'got 224 response for OVER');
                is($r[1], "0\thihi\tMe <me\@example.com>\t" .