diff --git a/minimal-examples/http-client/minimal-http-client-multi/README.md b/minimal-examples/http-client/minimal-http-client-multi/README.md index f31b62285..7eaac9ddb 100644 --- a/minimal-examples/http-client/minimal-http-client-multi/README.md +++ b/minimal-examples/http-client/minimal-http-client-multi/README.md @@ -21,4 +21,5 @@ Option|Meaning -p|Use http/1.1 pipelining or h2 simultaneous streams --h1|Force http/1 only -l|Connect to server on https://localhost:7681 instead of https://warmcat.com:443 +-n|Read numbered files like /1.png, /2.png etc. Default is just read / diff --git a/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c b/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c index 19940ffeb..b84e01e3f 100644 --- a/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c +++ b/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c @@ -40,7 +40,7 @@ struct user { int index; }; -static int interrupted, completed, failed; +static int interrupted, completed, failed, numbered; static struct lws *client_wsi[COUNT]; static struct user user[COUNT]; @@ -154,7 +154,13 @@ unsigned long long us(void) static void lws_try_client_connection(struct lws_client_connect_info *i, int m) { - i->path = "/"; + char path[128]; + + if (numbered) { + lws_snprintf(path, sizeof(path), "/%d.png", m + 1); + i->path = path; + } else + i->path = "/"; i->pwsi = &client_wsi[m]; user[m].index = m; @@ -167,7 +173,8 @@ lws_try_client_connection(struct lws_client_connect_info *i, int m) interrupted = 1; } } else - lwsl_user("started connection %p: idx %d\n", client_wsi[m], m); + lwsl_user("started connection %p: idx %d (%s)\n", + client_wsi[m], m, i->path); } int main(int argc, const char **argv) @@ -196,7 +203,8 @@ int main(int argc, const char **argv) lws_set_log_level(logs, NULL); lwsl_user("LWS minimal http client [-s (staggered)] [-p (pipeline)]\n"); - lwsl_user(" [--h1 (http/1 only)] [-l (localhost)] [-d ]\n"); + lwsl_user(" [--h1 (http/1 only)] [-l (localhost)] [-d ]\n"); + lwsl_user(" [-n (numbered)]\n"); memset(&info, 0, sizeof info); /* otherwise uninitialized garbage */ info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; @@ -237,6 +245,9 @@ int main(int argc, const char **argv) i.address = "warmcat.com"; } + if (lws_cmdline_option(argc, argv, "-n")) + numbered = 1; + if ((p = lws_cmdline_option(argc, argv, "--port"))) i.port = atoi(p); diff --git a/test-apps/1.png b/test-apps/1.png new file mode 100644 index 000000000..4a022b9d6 Binary files /dev/null and b/test-apps/1.png differ diff --git a/test-apps/2.png b/test-apps/2.png new file mode 100644 index 000000000..d6bc9d1ba Binary files /dev/null and b/test-apps/2.png differ diff --git a/test-apps/3.png b/test-apps/3.png new file mode 100644 index 000000000..0f4614de6 Binary files /dev/null and b/test-apps/3.png differ diff --git a/test-apps/4.png b/test-apps/4.png new file mode 100644 index 000000000..4319faad6 Binary files /dev/null and b/test-apps/4.png differ diff --git a/test-apps/5.png b/test-apps/5.png new file mode 100644 index 000000000..4a2838cfb Binary files /dev/null and b/test-apps/5.png differ diff --git a/test-apps/6.png b/test-apps/6.png new file mode 100644 index 000000000..a6ee64814 Binary files /dev/null and b/test-apps/6.png differ diff --git a/test-apps/7.png b/test-apps/7.png new file mode 100644 index 000000000..d02ab8178 Binary files /dev/null and b/test-apps/7.png differ diff --git a/test-apps/8.png b/test-apps/8.png new file mode 100644 index 000000000..f2f6e808b Binary files /dev/null and b/test-apps/8.png differ