From b5dd54a404dccd4f80811368a52d46996aed058d Mon Sep 17 00:00:00 2001
From: Alexander Alashkin <alexander.alashkin@cesanta.com>
Date: Wed, 1 Mar 2017 08:03:50 +0200
Subject: [PATCH] Fix doc typos

PUBLISHED_FROM=1bdacf793b35ebe70d0a3a9d64260dd2bd135c73
---
 docs/c-api/coap.h/mg_coap_free_options.md         |  2 +-
 docs/c-api/dns.h/mg_dns_encode_record.md          |  2 +-
 docs/c-api/http_server.h/mg_http_send_redirect.md |  2 +-
 docs/c-api/http_server.h/mg_send_response_line.md |  2 +-
 docs/c-api/net.h/mg_bind_opt.md                   |  2 +-
 docs/c-api/net.h/mg_check_ip_acl.md               |  2 +-
 docs/http/ssi.md                                  |  2 +-
 mongoose.c                                        |  6 +++---
 mongoose.h                                        | 14 +++++++-------
 9 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/docs/c-api/coap.h/mg_coap_free_options.md b/docs/c-api/coap.h/mg_coap_free_options.md
index 9dcc816f4..d429cf49e 100644
--- a/docs/c-api/coap.h/mg_coap_free_options.md
+++ b/docs/c-api/coap.h/mg_coap_free_options.md
@@ -7,5 +7,5 @@ signature: |
 ---
 
 Frees the memory allocated for options.
-If the cm paramater doesn't contain any option it does nothing. 
+If the cm parameter doesn't contain any option it does nothing. 
 
diff --git a/docs/c-api/dns.h/mg_dns_encode_record.md b/docs/c-api/dns.h/mg_dns_encode_record.md
index c52cf26f3..7c9f2cf2b 100644
--- a/docs/c-api/dns.h/mg_dns_encode_record.md
+++ b/docs/c-api/dns.h/mg_dns_encode_record.md
@@ -21,5 +21,5 @@ This function doesn't update the `name` and `rdata` pointers in the `rr`
 struct because they might be invalidated as soon as the IO buffer grows
 again.
 
-Returns the number of bytes appened or -1 in case of error. 
+Returns the number of bytes appended or -1 in case of error. 
 
diff --git a/docs/c-api/http_server.h/mg_http_send_redirect.md b/docs/c-api/http_server.h/mg_http_send_redirect.md
index 8d7d3b2e2..00d704e0e 100644
--- a/docs/c-api/http_server.h/mg_http_send_redirect.md
+++ b/docs/c-api/http_server.h/mg_http_send_redirect.md
@@ -12,7 +12,7 @@ Sends a redirect response.
 `status_code` should be either 301 or 302 and `location` point to the
 new location.
 If `extra_headers` is not empty, then `extra_headers` are also sent
-after the reponse line. `extra_headers` must NOT end end with new line.
+after the response line. `extra_headers` must NOT end end with new line.
 
 Example:
 
diff --git a/docs/c-api/http_server.h/mg_send_response_line.md b/docs/c-api/http_server.h/mg_send_response_line.md
index 4bd22639a..5daa74fe8 100644
--- a/docs/c-api/http_server.h/mg_send_response_line.md
+++ b/docs/c-api/http_server.h/mg_send_response_line.md
@@ -9,7 +9,7 @@ signature: |
 
 Sends the response status line.
 If `extra_headers` is not NULL, then `extra_headers` are also sent
-after the reponse line. `extra_headers` must NOT end end with new line.
+after the response line. `extra_headers` must NOT end end with new line.
 Example:
 
      mg_send_response_line(nc, 200, "Access-Control-Allow-Origin: *");
diff --git a/docs/c-api/net.h/mg_bind_opt.md b/docs/c-api/net.h/mg_bind_opt.md
index a9cbf953e..5fc460540 100644
--- a/docs/c-api/net.h/mg_bind_opt.md
+++ b/docs/c-api/net.h/mg_bind_opt.md
@@ -15,7 +15,7 @@ the same as for the `mg_connect()` call, where `HOST` part is optional.
 `address` can be just a port number, e.g. `:8000`. To bind to a specific
 interface, an IP address can be specified, e.g. `1.2.3.4:8000`. By default,
 a TCP connection is created. To create UDP connection, prepend `udp://`
-prefix, e.g. `udp://:8000`. To summarize, `address` paramer has following
+prefix, e.g. `udp://:8000`. To summarize, `address` parameter has following
 format: `[PROTO://][IP_ADDRESS]:PORT`, where `PROTO` could be `tcp` or
 `udp`.
 
diff --git a/docs/c-api/net.h/mg_check_ip_acl.md b/docs/c-api/net.h/mg_check_ip_acl.md
index e3087e2b2..83c2c7ba2 100644
--- a/docs/c-api/net.h/mg_check_ip_acl.md
+++ b/docs/c-api/net.h/mg_check_ip_acl.md
@@ -18,7 +18,7 @@ Subnet masks may vary from 0 to 32, inclusive. The default setting
 is to allow all access. On each request the full list is traversed,
 and the last match wins. Example:
 
-`-0.0.0.0/0,+192.168/16` - deny all acccesses, only allow 192.168/16 subnet
+`-0.0.0.0/0,+192.168/16` - deny all accesses, only allow 192.168/16 subnet
 
 To learn more about subnet masks, see this
 link:https://en.wikipedia.org/wiki/Subnetwork[Wikipedia page on Subnetwork].
diff --git a/docs/http/ssi.md b/docs/http/ssi.md
index 2fcfbc4db..23c390e11 100644
--- a/docs/http/ssi.md
+++ b/docs/http/ssi.md
@@ -35,7 +35,7 @@ The exec directive is used to execute a command on a server,
 and show command's output. Example: `<!--#exec "ls -l" -->`
 
 The call directive is a way to invoke a C handler from the HTML page.
-On each occurence of `<!--#call PARAMS -->` directive,
+On each occurrence of `<!--#call PARAMS -->` directive,
 Mongoose calls a registered event handler with `MG_EV_SSI_CALL` event.
 Event parameter will point to the `PARAMS` string.
 An event handler can output any text, for example by calling
diff --git a/mongoose.c b/mongoose.c
index 5f84b7b13..8199252e9 100644
--- a/mongoose.c
+++ b/mongoose.c
@@ -2342,7 +2342,7 @@ MG_INTERNAL struct mg_connection *mg_create_connection(
  * Address format: [PROTO://][HOST]:PORT
  *
  * HOST could be IPv4/IPv6 address or a host name.
- * `host` is a destination buffer to hold parsed HOST part. Shoud be at least
+ * `host` is a destination buffer to hold parsed HOST part. Should be at least
  * MG_MAX_HOST_LEN bytes long.
  * `proto` is a returned socket type, either SOCK_STREAM or SOCK_DGRAM
  *
@@ -13395,7 +13395,7 @@ time_t mg_sl_if_poll(struct mg_iface *iface, int timeout_ms) {
             (SL_FD_ISSET(nc->sock, &write_set) ? _MG_F_FD_CAN_WRITE : 0) |
             (SL_FD_ISSET(nc->sock, &err_set) ? _MG_F_FD_ERROR : 0);
       }
-      /* SimpleLink does not report UDP sockets as writeable. */
+      /* SimpleLink does not report UDP sockets as writable. */
       if (nc->flags & MG_F_UDP && nc->send_mbuf.len > 0) {
         fd_flags |= _MG_F_FD_CAN_WRITE;
       }
@@ -13418,7 +13418,7 @@ time_t mg_sl_if_poll(struct mg_iface *iface, int timeout_ms) {
 void mg_sl_if_get_conn_addr(struct mg_connection *nc, int remote,
                             union socket_address *sa) {
   /* SimpleLink does not provide a way to get socket's peer address after
-   * accept or connect. Address hould have been preserved in the connection,
+   * accept or connect. Address should have been preserved in the connection,
    * so we do our best here by using it. */
   if (remote) memcpy(sa, &nc->sa, sizeof(*sa));
 }
diff --git a/mongoose.h b/mongoose.h
index ab74b05a8..192677ad6 100644
--- a/mongoose.h
+++ b/mongoose.h
@@ -3235,7 +3235,7 @@ typedef void (*mg_event_handler_t)(struct mg_connection *nc, int ev,
 #define MG_EV_POLL 0    /* Sent to each connection on each mg_mgr_poll() call */
 #define MG_EV_ACCEPT 1  /* New connection accepted. union socket_address * */
 #define MG_EV_CONNECT 2 /* connect() succeeded or failed. int *  */
-#define MG_EV_RECV 3    /* Data has benn received. int *num_bytes */
+#define MG_EV_RECV 3    /* Data has been received. int *num_bytes */
 #define MG_EV_SEND 4    /* Data has been written to a socket. int *num_bytes */
 #define MG_EV_CLOSE 5   /* Connection is closed. NULL */
 #define MG_EV_TIMER 6   /* now >= conn->ev_timer_time. double * */
@@ -3495,7 +3495,7 @@ struct mg_connection *mg_bind(struct mg_mgr *, const char *,
  * `address` can be just a port number, e.g. `:8000`. To bind to a specific
  * interface, an IP address can be specified, e.g. `1.2.3.4:8000`. By default,
  * a TCP connection is created. To create UDP connection, prepend `udp://`
- * prefix, e.g. `udp://:8000`. To summarize, `address` paramer has following
+ * prefix, e.g. `udp://:8000`. To summarize, `address` parameter has following
  * format: `[PROTO://][IP_ADDRESS]:PORT`, where `PROTO` could be `tcp` or
  * `udp`.
  *
@@ -3701,7 +3701,7 @@ int mg_resolve(const char *domain_name, char *ip_addr_buf, size_t buf_len);
  * is to allow all access. On each request the full list is traversed,
  * and the last match wins. Example:
  *
- * `-0.0.0.0/0,+192.168/16` - deny all acccesses, only allow 192.168/16 subnet
+ * `-0.0.0.0/0,+192.168/16` - deny all accesses, only allow 192.168/16 subnet
  *
  * To learn more about subnet masks, see this
  * link:https://en.wikipedia.org/wiki/Subnetwork[Wikipedia page on Subnetwork].
@@ -4794,7 +4794,7 @@ void mg_printf_http_chunk(struct mg_connection *nc, const char *fmt, ...);
 /*
  * Sends the response status line.
  * If `extra_headers` is not NULL, then `extra_headers` are also sent
- * after the reponse line. `extra_headers` must NOT end end with new line.
+ * after the response line. `extra_headers` must NOT end end with new line.
  * Example:
  *
  *      mg_send_response_line(nc, 200, "Access-Control-Allow-Origin: *");
@@ -4818,7 +4818,7 @@ void mg_http_send_error(struct mg_connection *nc, int code, const char *reason);
  * `status_code` should be either 301 or 302 and `location` point to the
  * new location.
  * If `extra_headers` is not empty, then `extra_headers` are also sent
- * after the reponse line. `extra_headers` must NOT end end with new line.
+ * after the response line. `extra_headers` must NOT end end with new line.
  *
  * Example:
  *
@@ -5392,7 +5392,7 @@ int mg_dns_copy_questions(struct mbuf *io, struct mg_dns_message *msg);
  * struct because they might be invalidated as soon as the IO buffer grows
  * again.
  *
- * Returns the number of bytes appened or -1 in case of error.
+ * Returns the number of bytes appended or -1 in case of error.
  */
 int mg_dns_encode_record(struct mbuf *io, struct mg_dns_resource_record *rr,
                          const char *name, size_t nlen, const void *rdata,
@@ -5730,7 +5730,7 @@ struct mg_coap_option *mg_coap_add_option(struct mg_coap_message *cm,
 
 /*
  * Frees the memory allocated for options.
- * If the cm paramater doesn't contain any option it does nothing.
+ * If the cm parameter doesn't contain any option it does nothing.
  */
 void mg_coap_free_options(struct mg_coap_message *cm);
 
-- 
GitLab