From fb71b790cda43b08d6869ae3a415b052ed4ba07b Mon Sep 17 00:00:00 2001 From: Peter Pentchev Date: Sun, 2 Oct 2016 02:21:03 +0300 Subject: [PATCH] Subject: Fix some typographical and grammatical errors. --- CMakeLists.txt | 2 +- README.build.md | 4 ++-- README.coding.md | 2 +- README.test-apps.md | 8 ++++---- doc/html/md_README.build.html | 4 ++-- doc/html/md_README.coding.html | 2 +- doc/html/md_README.test-apps.html | 8 ++++---- lib/http2.c | 2 +- lib/libwebsockets.c | 2 +- lib/lws-plat-unix.c | 2 +- lib/private-libwebsockets.h | 2 +- lib/server.c | 2 +- lib/service.c | 2 +- test-server/attack.sh | 2 +- test-server/test-echo.c | 2 +- test-server/test-ping.c | 2 +- test-server/test-server-http.c | 2 +- 17 files changed, 25 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6076f38c..d3c76b82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -417,7 +417,7 @@ if (NOT LWS_HAVE_inline) endif() endif() -# Put the libaries and binaries that get built into directories at the +# Put the libraries and binaries that get built into directories at the # top of the build tree rather than in hard-to-find leaf directories. SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") diff --git a/README.build.md b/README.build.md index 136da5b5..889f5ffb 100644 --- a/README.build.md +++ b/README.build.md @@ -269,11 +269,11 @@ and cd into it To set compile time flags you can either use one of the CMake gui applications -or do it via command line. +or do it via the command line. @subsection cmcocl Command line -To list avaialable options (omit the H if you don't want the help text): +To list available options (omit the H if you don't want the help text): cmake -LH .. diff --git a/README.coding.md b/README.coding.md index b53a2e7e..a8c5b94b 100644 --- a/README.coding.md +++ b/README.coding.md @@ -22,7 +22,7 @@ allow up to that many connections, minus whatever other file descriptors are in use by the user code. If you want to restrict that allocation, or increase it, you can use ulimit or -similar to change the avaiable number of file descriptors, and when restarted +similar to change the available number of file descriptors, and when restarted **libwebsockets** will adapt accordingly. diff --git a/README.test-apps.md b/README.test-apps.md index e9a3ae22..e863db7c 100644 --- a/README.test-apps.md +++ b/README.test-apps.md @@ -125,7 +125,7 @@ The test client supports SSL too, use $ libwebsockets-test-client localhost --ssl -s ``` -the -s tells it to accept the default selfsigned cert from the server, +the -s tells it to accept the default self-signed cert from the server, otherwise it will strictly fail the connection if there is no CA cert to validate the server's certificate. @@ -173,7 +173,7 @@ To test SSL/WSS client action, just run the client test with ``` $ libwebsockets-test-client localhost --ssl ``` -By default the client test applet is set to accept selfsigned +By default the client test applet is set to accept self-signed certificates used by the test server, this is indicated by the `use_ssl` var being set to `2`. Set it to `1` to reject any server certificate that it doesn't have a trusted CA cert for. @@ -221,7 +221,7 @@ Before you can even use the PING opcode that is part of the standard, you must complete a handshake with a specified protocol. By default lws-mirror-protocol is used which is supported by the test server. But if you are using it on -another server, you can specify the protcol to handshake with +another server, you can specify the protocol to handshake with by `--protocol=protocolname` @@ -369,7 +369,7 @@ to see the results @section autobahnnotes Autobahn Test Notes 1) Autobahn tests the user code + lws implementation. So to get the same -results, you need to follow test-echo.c in terms of user implmentation. +results, you need to follow test-echo.c in terms of user implementation. 2) Two of the tests make no sense for Libwebsockets to support and we fail them. diff --git a/doc/html/md_README.build.html b/doc/html/md_README.build.html index 8f67c33a..eb53806b 100644 --- a/doc/html/md_README.build.html +++ b/doc/html/md_README.build.html @@ -158,10 +158,10 @@ Building on mbed3

8) yotta build

Setting compile options

-

To set compile time flags you can either use one of the CMake gui applications or do it via command line.

+

To set compile time flags you can either use one of the CMake gui applications or do it via the command line.

Command line

-

To list avaialable options (omit the H if you don't want the help text):

    cmake -LH ..
+

To list available options (omit the H if you don't want the help text):

    cmake -LH ..
 

Then to set an option and build (for example turn off SSL support):

    cmake -DLWS_WITH_SSL=0 ..
 

or cmake -DLWS_WITH_SSL:BOOL=OFF ..

diff --git a/doc/html/md_README.coding.html b/doc/html/md_README.coding.html index 0964220e..31a10b81 100644 --- a/doc/html/md_README.coding.html +++ b/doc/html/md_README.coding.html @@ -72,7 +72,7 @@ Daemonization

Maximum number of connections

The maximum number of connections the library can deal with is decided when it starts by querying the OS to find out how many file descriptors it is allowed to open (1024 on Fedora for example). It then allocates arrays that allow up to that many connections, minus whatever other file descriptors are in use by the user code.

-

If you want to restrict that allocation, or increase it, you can use ulimit or similar to change the avaiable number of file descriptors, and when restarted libwebsockets will adapt accordingly.

+

If you want to restrict that allocation, or increase it, you can use ulimit or similar to change the available number of file descriptors, and when restarted libwebsockets will adapt accordingly.

Libwebsockets is singlethreaded

Libwebsockets works in a serialized event loop, in a single thread.

diff --git a/doc/html/md_README.test-apps.html b/doc/html/md_README.test-apps.html index ebf04393..dc2d58f1 100644 --- a/doc/html/md_README.test-apps.html +++ b/doc/html/md_README.test-apps.html @@ -102,7 +102,7 @@ Testing websocket client support

If you run the test server as described above, you can also connect to it using the test client as well as a browser.

1 $ libwebsockets-test-client localhost

will by default connect to the test server on localhost:7681 and print the dumb increment number from the server at the same time as drawing random circles in the mirror protocol; if you connect to the test server using a browser at the same time you will be able to see the circles being drawn.

The test client supports SSL too, use

-
1 $ libwebsockets-test-client localhost --ssl -s

the -s tells it to accept the default selfsigned cert from the server, otherwise it will strictly fail the connection if there is no CA cert to validate the server's certificate.

+
1 $ libwebsockets-test-client localhost --ssl -s

the -s tells it to accept the default self-signed cert from the server, otherwise it will strictly fail the connection if there is no CA cert to validate the server's certificate.

Choosing between test server variations

If you will be doing standalone serving with lws, ideally you should avoid making your own server at all, and use lwsws with your own protocol plugins.

@@ -114,13 +114,13 @@ Testing simple echo
1 $ libwebsockets-test-echo --client echo.websocket.org

This echo test is of limited use though because it doesn't negotiate any protocol. You can run the same test app as a local server, by default on localhost:7681

1 $ libwebsockets-test-echo

and do the echo test against the local echo server

1 $ libwebsockets-test-echo --client localhost --port 7681

If you add the --ssl switch to both the client and server, you can also test with an encrypted link.

Testing SSL on the client side

-

To test SSL/WSS client action, just run the client test with

1 $ libwebsockets-test-client localhost --ssl

By default the client test applet is set to accept selfsigned certificates used by the test server, this is indicated by the use_ssl var being set to 2. Set it to 1 to reject any server certificate that it doesn't have a trusted CA cert for.

+

To test SSL/WSS client action, just run the client test with

1 $ libwebsockets-test-client localhost --ssl

By default the client test applet is set to accept self-signed certificates used by the test server, this is indicated by the use_ssl var being set to 2. Set it to 1 to reject any server certificate that it doesn't have a trusted CA cert for.

Using the websocket ping utility

libwebsockets-test-ping connects as a client to a remote websocket server and pings it like the normal unix ping utility.

1 $ libwebsockets-test-ping localhost
2 handshake OK for protocol lws-mirror-protocol
3 Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.
4 64 bytes from localhost: req=1 time=0.1ms
5 64 bytes from localhost: req=2 time=0.1ms
6 64 bytes from localhost: req=3 time=0.1ms
7 64 bytes from localhost: req=4 time=0.2ms
8 64 bytes from localhost: req=5 time=0.1ms
9 64 bytes from localhost: req=6 time=0.2ms
10 64 bytes from localhost: req=7 time=0.2ms
11 64 bytes from localhost: req=8 time=0.1ms
12 ^C
13 --- localhost.localdomain websocket ping statistics ---
14 8 packets transmitted, 8 received, 0% packet loss, time 7458ms
15 rtt min/avg/max = 0.110/0.185/0.218 ms
16 $

By default it sends 64 byte payload packets using the 04 PING packet opcode type. You can change the payload size using the -s= flag, up to a maximum of 125 mandated by the 04 standard.

Using the lws-mirror protocol that is provided by the test server, libwebsockets-test-ping can also use larger payload sizes up to 4096 is BINARY packets; lws-mirror will copy them back to the client and they appear as a PONG. Use the -m flag to select this operation.

The default interval between pings is 1s, you can use the -i= flag to set this, including fractions like -i=0.01 for 10ms interval.

-

Before you can even use the PING opcode that is part of the standard, you must complete a handshake with a specified protocol. By default lws-mirror-protocol is used which is supported by the test server. But if you are using it on another server, you can specify the protcol to handshake with by --protocol=protocolname

+

Before you can even use the PING opcode that is part of the standard, you must complete a handshake with a specified protocol. By default lws-mirror-protocol is used which is supported by the test server. But if you are using it on another server, you can specify the protocol to handshake with by --protocol=protocolname

fraggle Fraggle test app

By default it runs in server mode

1 $ libwebsockets-test-fraggle
2 libwebsockets test fraggle
3 (C) Copyright 2010-2011 Andy Green <andy@warmcat.com> licensed under LGPL2.1
4  Compiled with SSL support, not using it
5  Listening on port 7681
6 server sees client connect
7 accepted v06 connection
8 Spamming 360 random fragments
9 Spamming session over, len = 371913. sum = 0x2D3C0AE
10 Spamming 895 random fragments
11 Spamming session over, len = 875970. sum = 0x6A74DA1
12 ...

You need to run a second session in client mode, you have to give the -c switch and the server address at least:

1 $ libwebsockets-test-fraggle -c localhost
2 libwebsockets test fraggle
3 (C) Copyright 2010-2011 Andy Green <andy@warmcat.com> licensed under LGPL2.1
4  Client mode
5 Connecting to localhost:7681
6 denied deflate-stream extension
7 handshake OK for protocol fraggle-protocol
8 client connects to server
9 EOM received 371913 correctly from 360 fragments
10 EOM received 875970 correctly from 895 fragments
11 EOM received 247140 correctly from 258 fragments
12 EOM received 695451 correctly from 692 fragments
13 ...

The fraggle test sends a random number up to 1024 fragmented websocket frames each of a random size between 1 and 2001 bytes in a single message, then sends a checksum and starts sending a new randomly sized and fragmented message.

@@ -170,7 +170,7 @@ Autobahn Test Suite

to see the results

Autobahn Test Notes

-

1) Autobahn tests the user code + lws implementation. So to get the same results, you need to follow test-echo.c in terms of user implmentation.

+

1) Autobahn tests the user code + lws implementation. So to get the same results, you need to follow test-echo.c in terms of user implementation.

2) Two of the tests make no sense for Libwebsockets to support and we fail them.