aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Ermakov <evgeny.v.ermakov@gmail.com>2020-02-12 01:23:35 +1100
committerGarrett D'Amore <garrett@damore.org>2020-02-13 20:21:09 -0800
commit0a315e4e5f7d90789babba312079462953114e0d (patch)
tree193f07065b2145fca39406420666ee740166e117
parentcdda78dbb793e10a5fcbd4748b9d82207ff0f19a (diff)
downloadnng-0a315e4e5f7d90789babba312079462953114e0d.tar.gz
nng-0a315e4e5f7d90789babba312079462953114e0d.tar.bz2
nng-0a315e4e5f7d90789babba312079462953114e0d.zip
Fix typos in comments
-rw-r--r--demo/rest/server.c4
-rw-r--r--include/nng/compat/nanomsg/ipc.h2
-rw-r--r--include/nng/compat/nanomsg/nn.h2
-rw-r--r--include/nng/nng.h10
-rw-r--r--include/nng/supplemental/util/platform.h6
-rw-r--r--src/core/aio.c2
-rw-r--r--src/supplemental/http/http_server.c2
-rw-r--r--src/transport/zerotier/zerotier.c8
8 files changed, 18 insertions, 18 deletions
diff --git a/demo/rest/server.c b/demo/rest/server.c
index f4e8b19a..5a59756c 100644
--- a/demo/rest/server.c
+++ b/demo/rest/server.c
@@ -275,7 +275,7 @@ rest_start(uint16_t port)
fatal("nng_http_server_hold", rv);
}
- // Allocate the handler - we usea dynamic handler for REST
+ // Allocate the handler - we use a dynamic handler for REST
// using the function "rest_handle" declared above.
rv = nng_http_handler_alloc(&handler, url->u_path, rest_handle);
if (rv != 0) {
@@ -287,7 +287,7 @@ rest_start(uint16_t port)
}
// We want to collect the body, and we (arbitrarily) limit this to
// 128KB. The default limit is 1MB. You can explicitly collect
- // the deta yourself with another HTTP read transaction by disabling
+ // the data yourself with another HTTP read transaction by disabling
// this, but that's a lot of work, especially if you want to handle
// chunked transfers.
if ((rv = nng_http_handler_collect_body(handler, true, 1024 * 128)) !=
diff --git a/include/nng/compat/nanomsg/ipc.h b/include/nng/compat/nanomsg/ipc.h
index c935b50c..fad520d3 100644
--- a/include/nng/compat/nanomsg/ipc.h
+++ b/include/nng/compat/nanomsg/ipc.h
@@ -26,7 +26,7 @@ extern "C" {
// IPC options. Note that these are not currently supported.
// IPC_SEC_ATTR works quite differently in NNG, and must be
// configured using the new API. The buffer sizing options are
-// not supported at all. None of these were ever documente, and
+// not supported at all. None of these were ever documented, and
// are offered here only for source compatibility.
#define NN_IPC_SEC_ATTR 1
#define NN_IPC_OUTBUFSZ 2
diff --git a/include/nng/compat/nanomsg/nn.h b/include/nng/compat/nanomsg/nn.h
index 63431728..60c33c60 100644
--- a/include/nng/compat/nanomsg/nn.h
+++ b/include/nng/compat/nanomsg/nn.h
@@ -25,7 +25,7 @@
// error reporting facility expresses only a subset of the possibilities of
// nanomsg.
-// Note that unlinke nanomsg, nng does not aggressively recycle socket or
+// Note that unlike nanomsg, nng does not aggressively recycle socket or
// endpoint IDs, which means applications which made assumptions that these
// would be relatively small integers (e.g. to use them as array indices)
// may break. (No promise about values was ever made.)
diff --git a/include/nng/nng.h b/include/nng/nng.h
index 7cca4422..e061bd50 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -15,7 +15,7 @@
// The APIs have changed, and there is no attempt to provide API compatibility
// with legacy libnanomsg. This file defines the library consumer-facing
// Public API. Use of definitions or declarations not found in this header
-// file is specfically unsupported and strongly discouraged.
+// file is specifically unsupported and strongly discouraged.
#ifdef __cplusplus
extern "C" {
@@ -492,7 +492,7 @@ NNG_DECL int nng_ctx_open(nng_ctx *, nng_socket);
NNG_DECL int nng_ctx_close(nng_ctx);
// nng_ctx_id returns the numeric id for the context; this will be
-// a postive value for a valid context, or < 0 for an invalid context.
+// a positive value for a valid context, or < 0 for an invalid context.
// A valid context is not necessarily an *open* context.
NNG_DECL int nng_ctx_id(nng_ctx);
@@ -860,9 +860,9 @@ enum nng_flag_enum {
// Local TCP port number. This is used on a listener, and is intended
// to be used after starting the listener in combination with a wildcard
// (0) local port. This determines the actual ephemeral port that was
-// selected and bound. The value is provied as an int, but only the
+// selected and bound. The value is provided as an int, but only the
// low order 16 bits will be set. This is provided in native byte order,
-// which makes it more convienent than using the NNG_OPT_LOCADDR option.
+// which makes it more convenient than using the NNG_OPT_LOCADDR option.
#define NNG_OPT_TCP_BOUND_PORT "tcp-bound-port"
// IPC options. These will largely vary depending on the platform,
@@ -1053,7 +1053,7 @@ NNG_DECL int nng_device(nng_socket, nng_socket);
// Error codes. These generally have different values from UNIX errnos,
// so take care about converting them. The one exception is that 0 is
-// unambigiously "success".
+// unambiguously "success".
//
// NNG_SYSERR is a special code, which allows us to wrap errors from the
// underlying operating system. We generally prefer to map errors to one
diff --git a/include/nng/supplemental/util/platform.h b/include/nng/supplemental/util/platform.h
index 0fcc7d16..87e0305f 100644
--- a/include/nng/supplemental/util/platform.h
+++ b/include/nng/supplemental/util/platform.h
@@ -53,13 +53,13 @@ NNG_DECL int nng_thread_create(nng_thread **, void (*)(void *), void *);
// returns all resources for the thread are cleaned up.
NNG_DECL void nng_thread_destroy(nng_thread *);
-// nng_mtx represents a mutex, which is a simple, non-retrant, boolean lock.
+// nng_mtx represents a mutex, which is a simple, non-reentrant, boolean lock.
typedef struct nng_mtx nng_mtx;
// nng_mtx_alloc allocates a mutex structure.
NNG_DECL int nng_mtx_alloc(nng_mtx **);
-// nng_mtx_free frees the mutex. It most not be locked.
+// nng_mtx_free frees the mutex. It must not be locked.
NNG_DECL void nng_mtx_free(nng_mtx *);
// nng_mtx_lock locks the mutex; if it is already locked it will block
@@ -93,7 +93,7 @@ NNG_DECL void nng_cv_wake(nng_cv *);
// nng_cv_wake1 wakes only one thread waiting on the condition. This may
// reduce the thundering herd problem, but care must be taken to ensure
-// that no waiter starves forvever.
+// that no waiter starves forever.
NNG_DECL void nng_cv_wake1(nng_cv *);
// nng_random returns a "strong" (cryptographic sense) random number.
diff --git a/src/core/aio.c b/src/core/aio.c
index a15bb47b..2e38c323 100644
--- a/src/core/aio.c
+++ b/src/core/aio.c
@@ -43,7 +43,7 @@ static nni_aio *nni_aio_expire_aio;
//
// The aio framework is tightly bound up with the taskq framework. We
// "prepare" the task for an aio when a caller marks an aio as starting
-// (with nni_aio_begin), and that marks the task as bus. Then, all we have
+// (with nni_aio_begin), and that marks the task as busy. Then, all we have
// to do is wait for the task to complete (the busy flag to be cleared)
// when we want to know if the operation itself is complete.
//
diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c
index 5eadf6d5..d3b595fd 100644
--- a/src/supplemental/http/http_server.c
+++ b/src/supplemental/http/http_server.c
@@ -1453,7 +1453,7 @@ http_handle_dir(nni_aio *aio)
return;
}
- // simple worst case is every character in path is a seperator
+ // simple worst case is every character in path is a separator
// It's never actually that bad, because we we have /<something>/.
pnsz = (strlen(path) + strlen(uri) + 2) * strlen(NNG_PLATFORM_DIR_SEP);
pnsz += strlen("index.html") + 1; // +1 for term nul
diff --git a/src/transport/zerotier/zerotier.c b/src/transport/zerotier/zerotier.c
index 9d166ad2..bebe67a6 100644
--- a/src/transport/zerotier/zerotier.c
+++ b/src/transport/zerotier/zerotier.c
@@ -31,7 +31,7 @@
// to the Internet to use this. (Or at least to your Planetary root.)
//
// Because ZeroTier takes a while to establish connectivity, it is even
-// more important that applicaitons using the ZeroTier transport not
+// more important that applications using the ZeroTier transport not
// assume that a connection will be immediately available. It can take
// quite a few seconds for peer-to-peer connectivity to be established.
//
@@ -131,7 +131,7 @@ enum zt_errors {
zt_err_refused = 0x01, // Connection refused
zt_err_notconn = 0x02, // Connection does not exit
zt_err_wrongsp = 0x03, // SP protocol mismatch
- zt_err_proto = 0x04, // Other protocol errror
+ zt_err_proto = 0x04, // Other protocol error
zt_err_msgsize = 0x05, // Message to large
zt_err_unknown = 0x06, // Other errors
};
@@ -263,7 +263,7 @@ struct zt_ep {
// honest we don't think anyone will be using the ZeroTier transport in
// performance critical applications; scalability may become a factor for
// large servers sitting in a ZeroTier hub situation. (Then again, since
-// only the zerotier procesing is single threaded, it may not
+// only the zerotier processing is single threaded, it may not
// be that much of a bottleneck -- really depends on how expensive these
// operations are. We can use lockstat or other lock-hotness tools to
// check for this later.)
@@ -432,7 +432,7 @@ static uint64_t
zt_mac_to_node(uint64_t mac, uint64_t nwid)
{
uint64_t node;
- // This extracts a node address from a mac addres. The
+ // This extracts a node address from a mac address. The
// network ID is mixed in, and has to be extricated. We
// the node ID is located in the lower 40 bits, and scrambled
// against the nwid.