From f6911cdab8788362dd50a0d876c9cfe9ff0a8edc Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 19 Aug 2021 08:54:51 +0100 Subject: [PATCH] minimal: perf: add --test404[red] switches --test404 sends us instead to httpbin.org/status/404 --test404red goes to warmcat.com/noexist.html which is handled as a redirect to a 404 page (served with a 200...), streamtype allows redirects to be followed --test404redref same as above but streamtype disallows redirect follow These should all produce CONMON results for the first response, be it 404 or 302 and whether the 302 was followed or not, and whether the client goes via the proxy or not. --- .../minimal-secure-streams.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/minimal-examples/secure-streams/minimal-secure-streams-perf/minimal-secure-streams.c b/minimal-examples/secure-streams/minimal-secure-streams-perf/minimal-secure-streams.c index be41e6b68..b4264612f 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-perf/minimal-secure-streams.c +++ b/minimal-examples/secure-streams/minimal-secure-streams-perf/minimal-secure-streams.c @@ -39,6 +39,7 @@ static int interrupted, bad = 1, force_cpd_fail_portal, force_cpd_fail_no_internet, test_respmap; +static const char *streamtype = "mintest"; static unsigned int timeout_ms = 3000; static lws_state_notify_link_t nl; @@ -363,7 +364,7 @@ app_system_state_nf(lws_state_manager_t *mgr, lws_state_notify_link_t *link, ssi.tx = myss_tx; ssi.state = myss_state; ssi.user_alloc = sizeof(myss_t); - ssi.streamtype = test_respmap ? "respmap" : "mintest"; + ssi.streamtype = test_respmap ? "respmap" : streamtype; if (lws_ss_create(context, 0, &ssi, NULL, NULL, NULL, NULL)) { @@ -437,6 +438,15 @@ int main(int argc, const char **argv) if (lws_cmdline_option(argc, argv, "--respmap")) test_respmap = 1; + if (lws_cmdline_option(argc, argv, "--test404")) + streamtype = "mintest404"; + + if (lws_cmdline_option(argc, argv, "--test404red")) + streamtype = "mintest404red"; + + if (lws_cmdline_option(argc, argv, "--test404redref")) + streamtype = "mintest404redref"; + if ((p = lws_cmdline_option(argc, argv, "--timeout_ms"))) timeout_ms = (unsigned int)atoi(p);