Subject: Fix some typographical and grammatical errors.
authorPeter Pentchev <roam@ringlet.net>
Sat, 1 Oct 2016 23:21:03 +0000 (02:21 +0300)
committerAndy Green <andy@warmcat.com>
Mon, 3 Oct 2016 13:31:27 +0000 (21:31 +0800)
17 files changed:
CMakeLists.txt
README.build.md
README.coding.md
README.test-apps.md
doc/html/md_README.build.html
doc/html/md_README.coding.html
doc/html/md_README.test-apps.html
lib/http2.c
lib/libwebsockets.c
lib/lws-plat-unix.c
lib/private-libwebsockets.h
lib/server.c
lib/service.c
test-server/attack.sh
test-server/test-echo.c
test-server/test-ping.c
test-server/test-server-http.c

index 6076f38..d3c76b8 100644 (file)
@@ -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")
index 136da5b..889f5ff 100644 (file)
@@ -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 ..
 
index b53a2e7..a8c5b94 100644 (file)
@@ -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.
 
 
index e9a3ae2..e863db7 100644 (file)
@@ -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.
 
index 8f67c33..eb53806 100644 (file)
@@ -158,10 +158,10 @@ Building on mbed3</h1>
 <p>8) yotta build</p>
 <h1><a class="anchor" id="cmco"></a>
 Setting compile options</h1>
-<p>To set compile time flags you can either use one of the CMake gui applications or do it via command line.</p>
+<p>To set compile time flags you can either use one of the CMake gui applications or do it via the command line.</p>
 <h2><a class="anchor" id="cmcocl"></a>
 Command line</h2>
-<p>To list avaialable options (omit the H if you don't want the help text): </p><pre class="fragment">    cmake -LH ..
+<p>To list available options (omit the H if you don't want the help text): </p><pre class="fragment">    cmake -LH ..
 </pre><p>Then to set an option and build (for example turn off SSL support): </p><pre class="fragment">    cmake -DLWS_WITH_SSL=0 ..
 </pre><p> or cmake -DLWS_WITH_SSL:BOOL=OFF ..</p>
 <h2><a class="anchor" id="cmcoug"></a>
index 0964220..31a10b8 100644 (file)
@@ -72,7 +72,7 @@ Daemonization</h1>
 <h1><a class="anchor" id="conns"></a>
 Maximum number of connections</h1>
 <p>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.</p>
-<p>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 <b>libwebsockets</b> will adapt accordingly.</p>
+<p>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 <b>libwebsockets</b> will adapt accordingly.</p>
 <h1><a class="anchor" id="evtloop"></a>
 Libwebsockets is singlethreaded</h1>
 <p>Libwebsockets works in a serialized event loop, in a single thread.</p>
index ebf0439..dc2d58f 100644 (file)
@@ -102,7 +102,7 @@ Testing websocket client support</h1>
 <p>If you run the test server as described above, you can also connect to it using the test client as well as a browser.</p>
 <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-client localhost</div></div><!-- fragment --><p>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.</p>
 <p>The test client supports SSL too, use</p>
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-client localhost --ssl -s</div></div><!-- fragment --><p>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.</p>
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-client localhost --ssl -s</div></div><!-- fragment --><p>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.</p>
 <h1><a class="anchor" id="choosingts"></a>
 Choosing between test server variations</h1>
 <p>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.</p>
@@ -114,13 +114,13 @@ Testing simple echo</h1>
 <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-echo --client echo.websocket.org</div></div><!-- fragment --><p>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 </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-echo</div></div><!-- fragment --><p> and do the echo test against the local echo server </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-echo --client localhost --port 7681</div></div><!-- fragment --><p> If you add the <code>--ssl</code> switch to both the client and server, you can also test with an encrypted link.</p>
 <h1><a class="anchor" id="tassl"></a>
 Testing SSL on the client side</h1>
-<p>To test SSL/WSS client action, just run the client test with </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-client localhost --ssl</div></div><!-- fragment --><p> By default the client test applet is set to accept selfsigned certificates used by the test server, this is indicated by the <code>use_ssl</code> var being set to <code>2</code>. Set it to <code>1</code> to reject any server certificate that it doesn't have a trusted CA cert for.</p>
+<p>To test SSL/WSS client action, just run the client test with </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-client localhost --ssl</div></div><!-- fragment --><p> By default the client test applet is set to accept self-signed certificates used by the test server, this is indicated by the <code>use_ssl</code> var being set to <code>2</code>. Set it to <code>1</code> to reject any server certificate that it doesn't have a trusted CA cert for.</p>
 <h1><a class="anchor" id="taping"></a>
 Using the websocket ping utility</h1>
 <p>libwebsockets-test-ping connects as a client to a remote websocket server and pings it like the normal unix ping utility. </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-ping localhost</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;handshake OK for protocol lws-mirror-protocol</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;Websocket PING localhost.localdomain (127.0.0.1) 64 bytes of data.</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;64 bytes from localhost: req=1 time=0.1ms</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;64 bytes from localhost: req=2 time=0.1ms</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;64 bytes from localhost: req=3 time=0.1ms</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;64 bytes from localhost: req=4 time=0.2ms</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;64 bytes from localhost: req=5 time=0.1ms</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;64 bytes from localhost: req=6 time=0.2ms</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;64 bytes from localhost: req=7 time=0.2ms</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;64 bytes from localhost: req=8 time=0.1ms</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;^C</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;--- localhost.localdomain websocket ping statistics ---</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;8 packets transmitted, 8 received, 0% packet loss, time 7458ms</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;rtt min/avg/max = 0.110/0.185/0.218 ms</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;$</div></div><!-- fragment --><p> By default it sends 64 byte payload packets using the 04 PING packet opcode type. You can change the payload size using the <code>-s=</code> flag, up to a maximum of 125 mandated by the 04 standard.</p>
 <p>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 <code>-m</code> flag to select this operation.</p>
 <p>The default interval between pings is 1s, you can use the -i= flag to set this, including fractions like <code>-i=0.01</code> for 10ms interval.</p>
-<p>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 <code>--protocol=protocolname</code></p>
+<p>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 <code>--protocol=protocolname</code></p>
 <h1><a class="anchor" id="ta"></a>
 fraggle Fraggle test app</h1>
 <p>By default it runs in server mode </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-fraggle</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;libwebsockets test fraggle</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;(C) Copyright 2010-2011 Andy Green &lt;andy@warmcat.com&gt; licensed under LGPL2.1</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160; Compiled with SSL support, not using it</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160; Listening on port 7681</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;server sees client connect</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;accepted v06 connection</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;Spamming 360 random fragments</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;Spamming session over, len = 371913. sum = 0x2D3C0AE</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;Spamming 895 random fragments</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;Spamming session over, len = 875970. sum = 0x6A74DA1</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;...</div></div><!-- fragment --><p> You need to run a second session in client mode, you have to give the <code>-c</code> switch and the server address at least: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;$ libwebsockets-test-fraggle -c localhost</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;libwebsockets test fraggle</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;(C) Copyright 2010-2011 Andy Green &lt;andy@warmcat.com&gt; licensed under LGPL2.1</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160; Client mode</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;Connecting to localhost:7681</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;denied deflate-stream extension</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;handshake OK for protocol fraggle-protocol</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;client connects to server</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;EOM received 371913 correctly from 360 fragments</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;EOM received 875970 correctly from 895 fragments</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;EOM received 247140 correctly from 258 fragments</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;EOM received 695451 correctly from 692 fragments</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;...</div></div><!-- fragment --><p> 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.</p>
@@ -170,7 +170,7 @@ Autobahn Test Suite</h1>
 <p>to see the results</p>
 <h1><a class="anchor" id="autobahnnotes"></a>
 Autobahn Test Notes</h1>
-<p>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.</p>
+<p>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.</p>
 <p>2) Two of the tests make no sense for Libwebsockets to support and we fail them.</p>
 <ul>
 <li>Tests 2.10 + 2.11: sends multiple pings on one connection. Lws policy is to only allow one active ping in flight on each connection, the rest are dropped. The autobahn test itself admits this is not part of the standard, just someone's random opinion about how they think a ws server should act. So we will fail this by design and it is no problem about RFC6455 compliance. </li>
index 2f3ea01..ea94940 100644 (file)
@@ -479,7 +479,7 @@ int lws_http2_do_pps_send(struct lws_context *context, struct lws *wsi)
                        wsi->u.http.fd = LWS_INVALID_FILE;
 
                        if (lws_is_ssl(lws_http2_get_network_wsi(wsi))) {
-                               lwsl_info("skipping nonexistant ssl upgrade headers\n");
+                               lwsl_info("skipping nonexistent ssl upgrade headers\n");
                                break;
                        }
 
index 752fe34..96dcf07 100755 (executable)
@@ -1803,7 +1803,7 @@ lws_create_basic_wsi(struct lws_context *context, int tsi)
        new_wsi->pending_timeout = NO_PENDING_TIMEOUT;
        new_wsi->rxflow_change_to = LWS_RXFLOW_ALLOW;
 
-       /* intialize the instance struct */
+       /* initialize the instance struct */
 
        new_wsi->state = LWSS_CGI;
        new_wsi->mode = LWSCM_CGI;
index ee30d0f..1dd901e 100644 (file)
@@ -534,7 +534,7 @@ lws_interface_to_sa(int ipv6, const char *ifname, struct sockaddr_in *addr,
        freeifaddrs(ifr);
 
        if (rc == -1) {
-               /* check if bind to IP adddress */
+               /* check if bind to IP address */
 #ifdef LWS_USE_IPV6
                if (inet_pton(AF_INET6, ifname, &addr6->sin6_addr) == 1)
                        rc = 0;
index f475a37..55a41f1 100644 (file)
@@ -733,7 +733,7 @@ struct lws_context_per_thread {
  *   vhostwide SSL context
  *   vhostwide proxy
  *
- * heirarchy:
+ * hierarchy:
  *
  * context -> vhost -> wsi
  *
index 25c4347..78a81da 100644 (file)
@@ -1430,7 +1430,7 @@ lws_create_new_server_wsi(struct lws_vhost *vhost)
        new_wsi->pending_timeout = NO_PENDING_TIMEOUT;
        new_wsi->rxflow_change_to = LWS_RXFLOW_ALLOW;
 
-       /* intialize the instance struct */
+       /* initialize the instance struct */
 
        new_wsi->state = LWSS_HTTP;
        new_wsi->mode = LWSCM_HTTP_SERVING;
index d992932..7c924e2 100644 (file)
@@ -979,7 +979,7 @@ drain:
                        lws_change_pollfd(wsi, LWS_POLLIN, 0);
 
                        /* let user code know, he'll usually ask for writeable
-                        * callback and drain / reenable it there
+                        * callback and drain / re-enable it there
                         */
                        if (user_callback_handle_rxflow(
                                        wsi->protocol->callback,
index bf4823e..19dff02 100755 (executable)
@@ -233,7 +233,7 @@ check default
 check
 
 echo
-echo "---- nonexistant file"
+echo "---- nonexistent file"
 rm -f /tmp/lwscap
 echo -e "GET /nope HTTP/1.1\x0d\x0a\x0d\x0a" | nc $SERVER $PORT | sed '1,/^\r$/d'> /tmp/lwscap
 check media
index 854f032..efb0503 100644 (file)
@@ -182,7 +182,7 @@ static struct lws_protocols protocols[] = {
        /* first protocol must always be HTTP handler */
 
        {
-               "",             /* name - can be overriden with -e */
+               "",             /* name - can be overridden with -e */
                callback_echo,
                sizeof(struct per_session_data__echo),  /* per_session_data_size */
                MAX_ECHO_PAYLOAD,
index 25b8a15..a013e9b 100644 (file)
@@ -400,7 +400,7 @@ int main(int argc, char **argv)
                case 'r':
                        clients = atoi(optarg);
                        if (clients > MAX_PING_CLIENTS || clients < 1) {
-                               fprintf(stderr, "Max clients supportd = %d\n",
+                               fprintf(stderr, "Max clients supported = %d\n",
                                                              MAX_PING_CLIENTS);
                                return 1;
                        }
index 60cf02a..46913bc 100644 (file)
@@ -300,7 +300,7 @@ int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user,
                                                     LWS_O_RDONLY);
 
                        if (pss->fd == LWS_INVALID_FILE) {
-                               lwsl_err("faild to open file %s\n", leaf_path);
+                               lwsl_err("failed to open file %s\n", leaf_path);
                                return -1;
                        }