From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.5 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NORMAL_HTTP_TO_IP, NUMERIC_HTTP_ADDR shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CE2B41FA29 for ; Mon, 9 Jan 2023 05:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1673242480; bh=5EnTcweq6zbjsnLOR8nZZgvl0w+HuOQXKbX4VfWSvLc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wWDPGt6vNMaBPRb4cT0ncIjqq29+Ge8yaE3uFw+VjhvNRH1TYmBFThJvnJKi5NyNz 8wpPlqIXL9BiVtiOS1jTK7auIdTHkz+YqdxU4xuBnVM2FpLD9OkqfwhJ4uJeErhqox ulQiEEvmu78NwHpx5hVfwXHtghqIUYO1oOiUyVQo= From: Eric Wong 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 Message-Id: <20230109053440.2540892-3-e@80x24.org> In-Reply-To: <20230109053440.2540892-1-e@80x24.org> References: <20230109053440.2540892-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 is the +Set various internal knobs. Currently, C is the only knob supported: -C +C -Using the C header allows changing the aforementioned +Using the C header allows changing the aforementioned C value to a specified depth level. As with C, only make small adjustments as the memory cost can increase exponentially with each step. It is typically a good idea to reset (C) after changing the depth on a running process. -Headers other than C may be accepted in the future to +Headers other than C 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'); };