unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Subject: [PATCH 2/4] treewide: use --globoff with curl(1)
Date: Thu, 29 Sep 2022 17:48:29 +0000	[thread overview]
Message-ID: <20220929174831.2919939-3-e@80x24.org> (raw)
In-Reply-To: <20220929174831.2919939-1-e@80x24.org>

curl 7.29.0 (on CentOS 7.x) seems to mishandle square-bracketed
IPv6 addresses, at least.  Furthermore, we don't actually need
nor use the globbing in curl for lei when forwarding requests
from the lei command-line.  lei has its own globbing and
`--globoff' behavior for externals and none of it is intended
for curl.
---
 lib/PublicInbox/LeiCurl.pm | 4 ++--
 t/httpd-corner.t           | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/LeiCurl.pm b/lib/PublicInbox/LeiCurl.pm
index 5ffade99..4e602a48 100644
--- a/lib/PublicInbox/LeiCurl.pm
+++ b/lib/PublicInbox/LeiCurl.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # common option and torsocks(1) wrapping for curl(1)
@@ -27,7 +27,7 @@ sub new {
 	my ($cls, $lei, $curl) = @_;
 	$curl //= which('curl') // return $lei->fail('curl not found');
 	my $opt = $lei->{opt};
-	my @cmd = ($curl, qw(-Sf));
+	my @cmd = ($curl, qw(-gSf));
 	$cmd[-1] .= 's' if $opt->{quiet}; # already the default for "lei q"
 	$cmd[-1] .= 'v' if $opt->{verbose}; # we use ourselves, too
 	for my $o ($lei->curl_opt) {
diff --git a/t/httpd-corner.t b/t/httpd-corner.t
index 973cc55d..e16e8dc8 100644
--- a/t/httpd-corner.t
+++ b/t/httpd-corner.t
@@ -341,7 +341,7 @@ SKIP: {
 	my $url = "$base/sha1";
 	my ($r, $w);
 	pipe($r, $w) or die "pipe: $!";
-	my $cmd = [$curl, qw(--tcp-nodelay -T- -HExpect: -sSN), $url];
+	my $cmd = [$curl, qw(--tcp-nodelay -T- -HExpect: -gsSN), $url];
 	open my $cout, '+>', undef or die;
 	open my $cerr, '>', undef or die;
 	my $rdr = { 0 => $r, 1 => $cout, 2 => $cerr };
@@ -358,7 +358,7 @@ SKIP: {
 	seek($cout, 0, SEEK_SET);
 	is(<$cout>, sha1_hex($str), 'read expected body');
 
-	my $fh = popen_rd([$curl, '-sS', "$base/async-big"]);
+	my $fh = popen_rd([$curl, '-gsS', "$base/async-big"]);
 	my $n = 0;
 	my $non_zero = 0;
 	while (1) {
@@ -372,12 +372,12 @@ SKIP: {
 	is($non_zero, 0, 'read all zeros');
 
 	require_mods(@zmods, 4);
-	my $buf = xqx([$curl, '-sS', "$base/psgi-return-gzip"]);
+	my $buf = xqx([$curl, '-gsS', "$base/psgi-return-gzip"]);
 	is($?, 0, 'curl succesful');
 	IO::Uncompress::Gunzip::gunzip(\$buf => \(my $out));
 	is($out, "hello world\n");
 	my $curl_rdr = { 2 => \(my $curl_err = '') };
-	$buf = xqx([$curl, qw(-sSv --compressed),
+	$buf = xqx([$curl, qw(-gsSv --compressed),
 			"$base/psgi-return-compressible"], undef, $curl_rdr);
 	is($?, 0, 'curl --compressed successful');
 	is($buf, "goodbye world\n", 'gzipped response as expected');

  parent reply	other threads:[~2022-09-29 17:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 18:46 "make test" for 1.9.0 on centos-7 Konstantin Ryabitsev
2022-09-28 19:59 ` Eric Wong
2022-09-28 20:51   ` Konstantin Ryabitsev
2022-09-29 17:48     ` [PATCH 0/4] CentOS 7 fixes + fix Gcf2 everywhere Eric Wong
2022-09-29 17:48       ` [PATCH 1/4] syscall: initialize buffer for vec() Eric Wong
2022-09-29 17:48       ` Eric Wong [this message]
2022-09-29 17:48       ` [PATCH 3/4] gcf2: fix syntax error and require PublicInbox::Git Eric Wong
2022-09-29 17:48       ` [PATCH 4/4] tests: no IPv6 on old Net::NNTP, Mail::IMAPClient, HTTP::Tiny Eric Wong
2022-09-29 19:10       ` [PATCH 0/4] CentOS 7 fixes + fix Gcf2 everywhere Konstantin Ryabitsev
2022-09-29 19:40         ` Eric Wong
2022-09-29 17:54 ` "make test" for 1.9.0 on centos-7 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=20220929174831.2919939-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=konstantin@linuxfoundation.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.
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).