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] t/nntpd-tls: avoid test failure on OpenBSD 7.3
Date: Mon, 27 Nov 2023 07:26:28 +0000	[thread overview]
Message-ID: <20231127072628.833729-1-e@80x24.org> (raw)

The LibreSSL 3.7.2 on my OpenBSD 7.3 VM seems return 7 bytes of
junk data before EOF/ECONNRESET when a client attempts to write
plain-text to a TLS socket.
---
 t/nntpd-tls.t | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/t/nntpd-tls.t b/t/nntpd-tls.t
index a11a0dd9..a16cc015 100644
--- a/t/nntpd-tls.t
+++ b/t/nntpd-tls.t
@@ -187,8 +187,12 @@ for my $args (
 
 	my $s = tcp_connect($nntps);
 	syswrite($s, '->accept_SSL_ will fail on this!');
-	ok(!sysread($s, my $rbuf, 128), 'EOF or ECONNRESET on ->accept_SSL fail');
-
+	my @r;
+	do { # some platforms or OpenSSL versions need an extra read
+		push @r, sysread($s, my $rbuf, 128);
+	} while ($r[-1] && @r < 2);
+	ok(!$r[-1], 'EOF or ECONNRESET on ->accept_SSL fail') or
+		diag explain(\@r);
 	$c = undef;
 	$td->kill;
 	$td->join;

             reply	other threads:[~2023-11-27  7:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27  7:26 Eric Wong [this message]
2023-11-27 10:50 ` [PATCH] t/nntpd-tls: avoid test failure on OpenBSD 7.3 Štěpán Němec

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=20231127072628.833729-1-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).