user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
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	[thread overview]
Message-ID: <20150930210027.30479-12-e@80x24.org> (raw)
In-Reply-To: <20150930210027.30479-1-e@80x24.org>

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 <me\@example.com>\t" .
-- 
EW


  parent reply	other threads:[~2015-09-30 21:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 21:00 [PATCH 0/12] another round of NNTP updates Eric Wong
2015-09-30 21:00 ` [PATCH 01/12] search: remove get_subject_path Eric Wong
2015-09-30 21:00 ` [PATCH 02/12] nntp: HDR returns 225, not 224 Eric Wong
2015-09-30 21:00 ` [PATCH 03/12] nntp: reduce syscalls for LIST OVERVIEW.FMT Eric Wong
2015-09-30 21:00 ` [PATCH 04/12] remove unnecessary fields usage Eric Wong
2015-09-30 21:00 ` [PATCH 05/12] daemon: always autoflush stdout/stderr Eric Wong
2015-09-30 21:00 ` [PATCH 06/12] nntpd: avoid lazy require Eric Wong
2015-09-30 21:00 ` [PATCH 07/12] INSTALL: document Danga::Socket dependency for nntpd Eric Wong
2015-09-30 21:00 ` [PATCH 08/12] nntp: MODE READER denies posting Eric Wong
2015-09-30 21:00 ` [PATCH 09/12] nntp: implement LIST HEADERS Eric Wong
2015-09-30 21:00 ` [PATCH 10/12] nntp: implement OVER/XOVER summary in search document Eric Wong
2015-09-30 21:00 ` Eric Wong [this message]
2015-09-30 21:00 ` [PATCH 12/12] t/nntpd.t: additional tests for XHDR/HDR Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150930210027.30479-12-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).