From: Eric Wong <e@80x24.org>
To: mwrap-perl@80x24.org
Subject: [PATCH 2/2] s/X-Mwrap-BT-Depth/X-Mwrap-BT/
Date: Mon, 9 Jan 2023 05:34:40 +0000 [thread overview]
Message-ID: <20230109053440.2540892-3-e@80x24.org> (raw)
In-Reply-To: <20230109053440.2540892-1-e@80x24.org>
This is more consistent with the `MWRAP=bt:' use, since adding
`-Depth' seems unnecessary and makes curl commands too long.
---
httpd.h | 2 +-
script/mwrap-perl | 8 ++++----
t/httpd.t | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/httpd.h b/httpd.h
index 36e487d..89e366e 100644
--- a/httpd.h
+++ b/httpd.h
@@ -892,7 +892,7 @@ static enum mw_qev h1_parse_harder(struct mw_h1 *h1, struct mw_h1req *h1r,
* request bodies, so let pico handle parameters in
* HTTP request headers, instead.
*/
- if (NAME_EQ(hdr, "X-Mwrap-BT-Depth")) {
+ if (NAME_EQ(hdr, "X-Mwrap-BT")) {
errno = 0;
depth = strtol(hdr->value, &end, 10);
if (errno || !valid_end(end))
diff --git a/script/mwrap-perl b/script/mwrap-perl
index 48f5471..182b0bd 100644
--- a/script/mwrap-perl
+++ b/script/mwrap-perl
@@ -109,19 +109,19 @@ lazily to avoid contention and does not happen unless sleeping threads.
=item POST http://0/$PID/ctl
-Set various internal knobs. Currently, C<X-Mwrap-BT-Depth> is the
+Set various internal knobs. Currently, C<X-Mwrap-BT> is the
only knob supported:
-C<curl --unix-socket $DIR/$PID.sock -XPOST -HX-Mwrap-BT-Depth:1 http://0/$PID/ctl>
+C<curl --unix-socket $DIR/$PID.sock -XPOST -HX-Mwrap-BT:1 http://0/$PID/ctl>
-Using the C<X-Mwrap-BT-Depth> header allows changing the aforementioned
+Using the C<X-Mwrap-BT> header allows changing the aforementioned
C<bt:> value to a specified depth level. As with C<bt:>, only make small
adjustments as the memory cost can increase exponentially with each step.
It is typically a good idea to reset (C<http://0/$PID/reset>) after changing
the depth on a running process.
-Headers other than C<X-Mwrap-BT-Depth> may be accepted in the future to
+Headers other than C<X-Mwrap-BT> may be accepted in the future to
tweak other settings.
=back
diff --git a/t/httpd.t b/t/httpd.t
index 8f56f64..bf9100e 100644
--- a/t/httpd.t
+++ b/t/httpd.t
@@ -161,12 +161,12 @@ SKIP: {
$rc = system(@curl, qw(-d x=y), "http://0/$pid/reset");
is($rc, 0, 'curl /reset');
- $rc = system(@curl, qw(-HX-Mwrap-BT-Depth:10 -XPOST),
+ $rc = system(@curl, qw(-HX-Mwrap-BT:10 -XPOST),
"http://0/$pid/ctl");
- is($rc, 0, 'curl /ctl (X-Mwrap-BT-Depth)');
+ is($rc, 0, 'curl /ctl (X-Mwrap-BT)');
like(slurp($cout), qr/\bMWRAP=bt:10\b/, 'changed bt depth');
- $rc = system(@curl, qw(-HX-Mwrap-BT-Depth:10 -d blah http://0/ctl));
+ $rc = system(@curl, qw(-HX-Mwrap-BT:10 -d blah http://0/ctl));
is($rc >> 8, 22, '404 w/o PID prefix');
};
prev parent reply other threads:[~2023-01-09 5:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 5:34 [PATCH 0/2] doc and usability updates Eric Wong
2023-01-09 5:34 ` [PATCH 1/2] documentation updates Eric Wong
2023-01-09 5:34 ` Eric Wong [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230109053440.2540892-3-e@80x24.org \
--to=e@80x24.org \
--cc=mwrap-perl@80x24.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/mwrap-perl.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).