1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

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.
This commit is contained in:
Andy Green 2021-08-19 08:54:51 +01:00
parent 1b9ef51a95
commit f6911cdab8

View file

@ -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);