From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A2F43201C7 for ; Wed, 30 Sep 2015 21:00:31 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 11/12] t/nntpd.t: simplify condition for response termination Date: Wed, 30 Sep 2015 21:00:26 +0000 Message-Id: <20150930210027.30479-12-e@80x24.org> In-Reply-To: <20150930210027.30479-1-e@80x24.org> References: <20150930210027.30479-1-e@80x24.org> List-Id: 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/nntpd.t b/t/nntpd.t index e4c0244..8a721e2 100644 --- 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 \t" . -- EW