diff options
author | Andy Green <andy@warmcat.com> | 2011-05-24 22:06:17 +0100 |
---|---|---|
committer | Andy Green <andy@warmcat.com> | 2011-05-24 22:06:17 +0100 |
commit | 7448c7ee0bcc1302fa028a294c7c772f9e29a0b1 (patch) | |
tree | 082230e09446902ccc08217089a5b177a6c985ad /test-server | |
parent | 4084af17451978e38938c64139758c349eddcfd5 (diff) |
test client add flag to defeat mux extension
Signed-off-by: Andy Green <andy@warmcat.com>
Diffstat (limited to 'test-server')
-rw-r--r-- | test-server/test-client.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/test-server/test-client.c b/test-server/test-client.c index 5d98c0e..3fecd47 100644 --- a/test-server/test-client.c +++ b/test-server/test-client.c @@ -30,6 +30,7 @@ static unsigned int opts; static int was_closed; static int deny_deflate; +static int deny_mux; static struct libwebsocket *wsi_mirror; /* @@ -78,11 +79,15 @@ callback_dumb_increment(struct libwebsocket_context * this, /* because we are protocols[0] ... */ case LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED: - if (strcmp(in, "deflate-stream") == 0) - if (deny_deflate) { - fprintf(stderr, "denied deflate-stream extension\n"); - return 1; - } + if ((strcmp(in, "deflate-stream") == 0) && deny_deflate) { + fprintf(stderr, "denied deflate-stream extension\n"); + return 1; + } + if ((strcmp(in, "x-google-mux") == 0) && deny_mux) { + fprintf(stderr, "denied x-google-mux extension\n"); + return 1; + } + break; default: @@ -187,6 +192,7 @@ static struct option options[] = { { "killmask", no_argument, NULL, 'k' }, { "version", required_argument, NULL, 'v' }, { "undeflated", no_argument, NULL, 'u' }, + { "nomux", no_argument, NULL, 'n' }, { NULL, 0, 0, 0 } }; @@ -210,7 +216,7 @@ int main(int argc, char **argv) goto usage; while (n >= 0) { - n = getopt_long(argc, argv, "uv:khsp:", options, NULL); + n = getopt_long(argc, argv, "nuv:khsp:", options, NULL); if (n < 0) continue; switch (n) { @@ -229,6 +235,9 @@ int main(int argc, char **argv) case 'u': deny_deflate = 1; break; + case 'n': + deny_mux = 1; + break; case 'h': goto usage; } |