aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--UKRAINE.md2
-rw-r--r--demo/stream/stream.c4
-rw-r--r--docs/BUILD_CROSSCOMPILE.adoc2
-rw-r--r--docs/RATIONALE.adoc8
-rw-r--r--docs/man/man7.desc2
-rw-r--r--docs/ref/api/aio.md2
-rw-r--r--docs/ref/api/ctx.md2
-rw-r--r--docs/ref/api/errors.md2
-rw-r--r--docs/ref/api/http.md14
-rw-r--r--docs/ref/api/id_map.md4
-rw-r--r--docs/ref/api/init.md8
-rw-r--r--docs/ref/api/logging.md4
-rw-r--r--docs/ref/api/msg.md2
-rw-r--r--docs/ref/api/sock.md2
-rw-r--r--docs/ref/api/stats.md6
-rw-r--r--docs/ref/api/synch.md4
-rw-r--r--docs/ref/api/thread.md2
-rw-r--r--docs/ref/api/time.md2
-rw-r--r--docs/ref/migrate/nng1.md8
-rw-r--r--include/nng/http.h2
-rw-r--r--include/nng/nng.h8
-rw-r--r--src/core/file.h2
-rw-r--r--src/core/sockaddr.c2
-rw-r--r--src/core/socket.h2
-rw-r--r--src/platform/windows/win_socketpair.c2
-rw-r--r--src/sp/protocol/reqrep0/req_test.c2
-rw-r--r--src/sp/protocol/survey0/survey_test.c2
-rw-r--r--src/sp/transport.h6
-rw-r--r--src/sp/transport/udp/udp.c2
-rw-r--r--src/supplemental/http/http_server_test.c4
-rw-r--r--src/testing/nuts.h2
-rwxr-xr-xsrc/tools/nngcat/nngcat_ambiguous_test.sh2
-rw-r--r--src/tools/perf/pubdrop.c2
-rw-r--r--tests/convey.h4
35 files changed, 65 insertions, 65 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7db5f81d..7d80ba3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,7 @@ set(NNG_PATCH_VERSION ${CMAKE_MATCH_1})
string(REGEX MATCH "NNG_RELEASE_SUFFIX \"([a-z0-9]*)\"" _ ${nng_ver_h})
set(NNG_DEV_VERSION ${CMAKE_MATCH_1})
if (NNG_DEV_VERSION)
- message(STATUS "This is a prelease.")
+ message(STATUS "This is a prerelease.")
set(NNG_PRERELEASE "-${NNG_DEV_VERSION}")
endif ()
@@ -192,7 +192,7 @@ if (NNG_ENABLE_COVERAGE)
else ()
message(FATAL_ERROR "Unable to enable coverage for your compiler.")
endif ()
- add_definitions(-DNNG_CONVERAGE)
+ add_definitions(-DNNG_COVERAGE)
endif ()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NNG_WARN_FLAGS} ${NNG_COVERAGE_C_FLAGS} ${NNG_SANITIZER_FLAGS}")
@@ -219,7 +219,7 @@ else()
include(TestBigEndian)
test_big_endian(NNG_BIG_ENDIAN)
if (NNG_BIG_ENDIAN)
- add_definitions(-DNNG_BIG_EDNDIAN=1)
+ add_definitions(-DNNG_BIG_ENDIAN=1)
else()
add_definitions(-DNNG_LITTLE_ENDIAN=1)
endif()
diff --git a/UKRAINE.md b/UKRAINE.md
index c67ca96d..cadd968d 100644
--- a/UKRAINE.md
+++ b/UKRAINE.md
@@ -123,6 +123,6 @@ people of both Ukraine and Russia continue to suffer under this needless, pointl
the ego of a dictator.
The actions done here, have killed thousands, probably hundreds of thousands, of soldiers and civilians alike, and there seems to be no end to the madness. I still pray for sanity to return, because the current path, if followed
-to its logical conclusion, most likely ends in apocalpyse.
+to its logical conclusion, most likely ends in apocalypse.
If you find my sharing these truths uncomfortable, please feel welcome to cease use of my software. While the license does permit use by anyone for any reason, I would not be displeased if the Russian military, and those sympathetic to it, declined from use of any of my work.
diff --git a/demo/stream/stream.c b/demo/stream/stream.c
index 0c194111..86c1c98d 100644
--- a/demo/stream/stream.c
+++ b/demo/stream/stream.c
@@ -63,7 +63,7 @@ client(const char *url)
nng_iov iov;
int rv;
- // Allocatate dialer and aio assoicated with this connection
+ // Allocate dialer and aio associated with this connection
if ((rv = nng_stream_dialer_alloc(&dialer, url)) != 0) {
nng_fatal("call to nng_stream_dialer_alloc failed", rv);
}
@@ -125,7 +125,7 @@ server(const char *url)
nng_iov iov;
int rv;
- // Allocatate dialer and aio assoicated with this connection
+ // Allocate dialer and aio associated with this connection
if ((rv = nng_stream_listener_alloc(&listener, url)) != 0) {
nng_fatal("call to nng_stream_listener_alloc failed", rv);
}
diff --git a/docs/BUILD_CROSSCOMPILE.adoc b/docs/BUILD_CROSSCOMPILE.adoc
index ba080b3f..f454726a 100644
--- a/docs/BUILD_CROSSCOMPILE.adoc
+++ b/docs/BUILD_CROSSCOMPILE.adoc
@@ -4,7 +4,7 @@ endif::[]
= Building for Cross Compilation
-TIP: Cross-compiling is used when the operating system or process architecure
+TIP: Cross-compiling is used when the operating system or process architecture
the software is being built for is different than the system where the software
is being compiled. If you don't know what this means, this does not apply to
and you should ignore this file.
diff --git a/docs/RATIONALE.adoc b/docs/RATIONALE.adoc
index b278ce3f..6a1423c3 100644
--- a/docs/RATIONALE.adoc
+++ b/docs/RATIONALE.adoc
@@ -51,7 +51,7 @@ many of which feed into others, such that tracking flow through the state
machines is incredibly painful.
Worse, these state machines are designed to be run from a single worker
-thread. This means that a given socket is entirely single theaded; you
+thread. This means that a given socket is entirely single threaded; you
could in theory have dozens, hundreds, or even thousands of connections
open, but they would be serviced only by a single thread. (Admittedly
non-blocking I/O is used to let the OS kernel calls run asynchronously
@@ -108,7 +108,7 @@ This means that implementing new transports which might need something
other than a file descriptor, is really non-trivial. This stymied my
first attempt to add http://www.openssl.org[OpenSSL] support to get TLS
added -- _OpenSSL_ has it's own `struct BIO` for this stuff, and I could
-not see an easy way to convert _nanomsg_'s `usock` stuff to accomodate the
+not see an easy way to convert _nanomsg_'s `usock` stuff to accommodate the
`struct BIO`.
In retrospect, _OpenSSL_ wasn't the ideal choice for an SSL/TLS library,
@@ -231,7 +231,7 @@ The completion routines are _usually_ run on a separate worker thread
available number of CPU cores to ensure that we never wait while a CPU
core is available for work), but they can be run "synchronously" if
the I/O provider knows it is safe to do so (for example the completion
-is occuring in a context where no locks are held.)
+is occurring in a context where no locks are held.)
The `nni_aio` structures are accessible to user applications as well, which can
lead to much more efficient and easier to write asynchronous applications,
@@ -291,7 +291,7 @@ layer makes implementation of these all fairly straight-forward.
As part of implementing a real WebSocket transport, it was necessary to
implement at least some HTTP capabilities. Rather than just settle for a toy
-implementation, _nng_ has a very capable HTTP server and client framework.
+implementation, _nng_ has a very capable HTTP server and client framework.
The server can be used to build real web services, so it becomes possible
for example to serve static content, REST API, and _nng_ based services
all from the same TCP port using the same program.
diff --git a/docs/man/man7.desc b/docs/man/man7.desc
index eae6694f..25d0ca2d 100644
--- a/docs/man/man7.desc
+++ b/docs/man/man7.desc
@@ -8,7 +8,7 @@ A given xref:nng_socket.5.adoc[socket] is created with exactly one protocol, and
protocol defines the key behavior of the socket.
(((transport)))
-Conversely, transports are the underlying mechansims by which messages
+Conversely, transports are the underlying mechanisms by which messages
are moved between participants, such as TCP/IP or UNIX domain IPC.
A given xref:nng_socket.5.adoc[socket] may be using several transports at the same
time.
diff --git a/docs/ref/api/aio.md b/docs/ref/api/aio.md
index 2f7b9a73..b6e0ad58 100644
--- a/docs/ref/api/aio.md
+++ b/docs/ref/api/aio.md
@@ -197,7 +197,7 @@ void nng_aio_set_msg(nng_aio *aio, nng_msg *msg);
The {{i:`nng_aio_get_msg`}} and {{i:`nng_aio_set_msg`}} functions retrieve and store a [message]
in _aio_.
For example, if a function to receive data is called, that function can generally be expected
-to store a message on the asssociated _aio_, for the application to retrieve with
+to store a message on the associated _aio_, for the application to retrieve with
`nng_aio_get_msg`.
Conversely an application desiring to send a message _msg_ will store it in the _aio_ using
`nng_aio_set_msg`. The function implementing the send operation will retrieve the message
diff --git a/docs/ref/api/ctx.md b/docs/ref/api/ctx.md
index 7f18b988..bc83d6db 100644
--- a/docs/ref/api/ctx.md
+++ b/docs/ref/api/ctx.md
@@ -138,7 +138,7 @@ These functions (, {{i:`nng_ctx_recvmsg`}} and {{i:`nng_ctx_recv`}}) receive
messages over the context _ctx_. The differences in their behaviors are as follows.
> [!NOTE]
-> The semantics of what receving a message means varies from protocol to
+> The semantics of what receiving a message means varies from protocol to
> protocol, so examination of the protocol documentation is encouraged.
> Additionally, some protocols may not support receiving at all or may require other pre-conditions first.
> (For example, [REQ][req] sockets cannot normally receive data until they have first sent a request.)
diff --git a/docs/ref/api/errors.md b/docs/ref/api/errors.md
index c7a50780..5d59d121 100644
--- a/docs/ref/api/errors.md
+++ b/docs/ref/api/errors.md
@@ -47,7 +47,7 @@ future locale-specific strings may be presented instead.
| Error | Value | Description |
| ------------------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NNG_EINTR`<a name="NNG_EINTR"></a> | 1 | Operation interrupted. |
-| `NNG_ENOMEM`<a name="NNG_ENOMEM"></a> | 2 | Out of memory, or other resource exahusted. |
+| `NNG_ENOMEM`<a name="NNG_ENOMEM"></a> | 2 | Out of memory, or other resource exhausted. |
| `NNG_EINVAL`<a name="NNG_EINVAL"></a> | 3 | Invalid argument. The arguments are invalid or malformed somehow. |
| `NNG_EBUSY`<a name="NNG_EBUSY"></a> | 4 | Resource busy. |
| `NNG_ETIMEDOUT`<a name="NNG_ETIMEDOUT"></a> | 5 | Timed out. The operation took longer than the allotted time. |
diff --git a/docs/ref/api/http.md b/docs/ref/api/http.md
index 8cb1945e..04c3ee4a 100644
--- a/docs/ref/api/http.md
+++ b/docs/ref/api/http.md
@@ -71,7 +71,7 @@ or [`NNG_EINVAL`] if there is some other problem with the URI.
The {{i:`nni_http_get_uri`}} function is used to obtain the URI that was previously set by `nng_http_set_uri`.
If the URI is unset (such as for a freshly created connection), then it returns `NULL`. The returned value
-will have any query concentated, for example "/api/get_user.cgi?name=garrett".
+will have any query concatenated, for example "/api/get_user.cgi?name=garrett".
### HTTP Version
@@ -119,7 +119,7 @@ then a built in reason based on the _status_ will be used instead.
> `nng_http_set_status`, because those functions will also set the response body to a suitable HTML document
> for display to users.
-Status codes are defined by the IETF. Here are defininitions that NNG provides for convenience:
+Status codes are defined by the IETF. Here are definitions that NNG provides for convenience:
| Name | Code | Reason Text | Notes |
| ------------------------------------------------------------------------------------------------ | ---- | ------------------------------- | ----------------------------------------------------- |
@@ -165,13 +165,13 @@ Status codes are defined by the IETF. Here are defininitions that NNG provides f
| `NNG_HTTP_STATUS_TEAPOT`<a name="#NNG_HTTP_STATUS_TEAPOT"></a> | 418 | I Am A Teapot | RFC 2324. |
| `NNG_HTTP_STATUS_UNPROCESSABLE_ENTITY`<a name="#NNG_HTTP_STATUS_UNPROCESSABLE_ENTITY"></a> | 422 | Unprocessable Entity |
| `NNG_HTTP_STATUS_LOCKED`<a name="#NNG_HTTP_STATUS_LOCKED"></a> | 423 | Locked |
-| `NNG_HTTP_STATUS_FAILED_DEPENDENCY`<a name="#NNG_HTTP_STATUS_FAILED_DEPEDNENCY"></a> | 424 | Failed Dependency |
+| `NNG_HTTP_STATUS_FAILED_DEPENDENCY`<a name="#NNG_HTTP_STATUS_FAILED_DEPENDENCY"></a> | 424 | Failed Dependency |
| `NNG_HTTP_STATUS_TOO_EARLY`<a name="#NNG_HTTP_STATUS_TOO_EARLY"></a> | 425 | Too Early |
| `NNG_HTTP_STATUS_UPGRADE_REQUIRED`<a name="#NNG_HTTP_STATUS_UPGRADE_REQUIRED"></a> | 426 | Upgrade Required |
| `NNG_HTTP_STATUS_PRECONDITION_REQUIRED`<a name="#NNG_HTTP_STATUS_PRECONDITION_REQUIRED"></a> | 428 | Precondition Required | |
| `NNG_HTTP_STATUS_TOO_MANY_REQUESTS`<a name="#NNG_HTTP_STATUS_TOO_MANY_REQUESTS"></a> | 429 | Too Many Requests | |
| `NNG_HTTP_STATUS_HEADERS_TOO_LARGE`<a name="#NNG_HTTP_STATUS_HEADERS_TOO_LARGE"></a> | 431 | Headers Too Large | |
-| `NNG_HTTP_STATUS_UNAVAIL_LEGAL_REASONS`<a name="#NNG_HTTP_STATUS_UNAVAIL_LEGAL_REASONS"></a> | 451 | Unavailabe For Legal Reasons | |
+| `NNG_HTTP_STATUS_UNAVAIL_LEGAL_REASONS`<a name="#NNG_HTTP_STATUS_UNAVAIL_LEGAL_REASONS"></a> | 451 | Unavailable For Legal Reasons | |
| `NNG_HTTP_STATUS_INTERNAL_SERVER_ERROR`<a name="#NNG_HTTP_STATUS_INTERNAL_SERVER_ERROR"></a> | 500 | Internal Server Error |
| `NNG_HTTP_STATUS_NOT_IMPLEMENTED`<a name="#NNG_HTTP_STATUS_NOT_IMPLEMENTED"></a> | 501 | Not Implemented | Server does not implement method. |
| `NNG_HTTP_STATUS_BAD_GATEWAY`<a name="#NNG_HTTP_STATUS_BAD_GATEWAY"></a> | 502 | Bad Gateway |
@@ -406,7 +406,7 @@ Calling `nng_http_client_set_tls` invalidates any client previously obtained wit
Once TLS is enabled for an `nng_http_client`, it is not possible to disable TLS.
> [!NOTE]
-> The TLS configuration itself cannnot be changed once it has been used to create a connection,
+> The TLS configuration itself cannot be changed once it has been used to create a connection,
> such as by calling [`nng_http_client_connect`], but a new one can be installed in the client.
> Existing connections will use the TLS configuration that there were created with.
@@ -573,7 +573,7 @@ rather than just a single element.
### Implementing a Handler
```c
-typedef void (*nng_http_hander_func)(nng_http_conn *conn, void *arg, nng_aio *aio);
+typedef void (*nng_http_handler_func)(nng_http_conn *conn, void *arg, nng_aio *aio);
nng_err nng_http_handler_alloc(nng_http_handler **hp, const char *path, nng_http_handler_func cb);
```
@@ -674,7 +674,7 @@ void nng_http_handler_collect_body(nng_http_handler *handler, bool want, size_t
```
The {{i:`nng_http_handler_collect_body`}} function requests that HTTP server
-framework collect any reuqest body for the request and attach it to the
+framework collect any request body for the request and attach it to the
connection before calling the callback for the _handler_.
Subsequently the data can be retrieved by the handler from the request with the
diff --git a/docs/ref/api/id_map.md b/docs/ref/api/id_map.md
index fcbae848..b25c9e64 100644
--- a/docs/ref/api/id_map.md
+++ b/docs/ref/api/id_map.md
@@ -23,7 +23,7 @@ can also be randomly within the range.
The identifiers are 64-bit unsigned integers and can be sparse; the structure
will use space efficiently even if identifiers are very far apart.
-{{footnote: The ID map is capable of storing at most 2<sup>32</sup> identifiers, even though the identifers may
+{{footnote: The ID map is capable of storing at most 2<sup>32</sup> identifiers, even though the identifiers may
themselves be much larger than this.}}
> [!IMPORTANT]
@@ -66,7 +66,7 @@ with it.
> [!NOTE]
> The `nng_id_map_free` frees the map itself, but will not free memory associated with
-> any strctures contained within it.
+> any structures contained within it.
## Store a Value
diff --git a/docs/ref/api/init.md b/docs/ref/api/init.md
index e26b2904..e0eedb5b 100644
--- a/docs/ref/api/init.md
+++ b/docs/ref/api/init.md
@@ -1,7 +1,7 @@
# Initialization & Finalization
This chapter details the function used to initialize
-the library before first use, and the funtion used to
+the library before first use, and the function used to
finalize the library and deallocate any resources used by the library.
## Initialization
@@ -17,7 +17,7 @@ typedef struct {
int16_t num_resolver_threads;
} nng_init_params;
-extern nng_err nng_init(nng_init_parms *params);
+extern nng_err nng_init(nng_init_params *params);
```
Before using other interfaces in this library, it is necessary to initialize
@@ -52,7 +52,7 @@ The following parameters are present:
- `num_task_threads` and `max_task_threads` \
Configures the number of threads to use for tasks, which are used principally for completion
callbacks. The maximum value can be used to provide an upper limit while still allowing
- for a dynamically calculated value to be used, as long as it does not exceeed the maximum.
+ for a dynamically calculated value to be used, as long as it does not exceed the maximum.
- `num_expire_threads` and `max_expire_threads` \
Configures the number of threads used for expiring operations. Using a larger value will
@@ -71,7 +71,7 @@ The following parameters are present:
extern void nng_fini(void);
```
-When the consumer is ready to deallocate any resoures allocated by the library, it should call
+When the consumer is ready to deallocate any resources allocated by the library, it should call
the {{i:`nng_fini`}} function. Each call to `nng_fini` should be paired with an earlier call to
[`nng_init`].
diff --git a/docs/ref/api/logging.md b/docs/ref/api/logging.md
index 75a6c356..01e63ec3 100644
--- a/docs/ref/api/logging.md
+++ b/docs/ref/api/logging.md
@@ -20,11 +20,11 @@ void nng_log_debug(const char *msgid, const char *msg, ...);
These {{hi:`nng_log`}} functions inject a a message into the
logging system, where it will be processed and potentially go to
-system logs, standard output, or procssed further.
+system logs, standard output, or processed further.
The _msgid_ is a short prefix that should uniquely identify the message,
possibly also with some kind of category. It is recommended that
-strings between 8 and 16 charactes be used. As this may, but will not necessarily
+strings between 8 and 16 characters be used. As this may, but will not necessarily
be displayed to the user, the content of the message should not appear
solely in this field. A `NULL` value is permitted here, but that may
make filtering the message or other automatic processing more difficult.
diff --git a/docs/ref/api/msg.md b/docs/ref/api/msg.md
index 1cea98e6..5aa7ef8f 100644
--- a/docs/ref/api/msg.md
+++ b/docs/ref/api/msg.md
@@ -48,7 +48,7 @@ int nng_msg_dup(nng_msg **dup, nng_msg *msg);
```
The {{i:`nng_msg_dup`}} function duplicates the message _msg_, storing a pointer
-to the new duplicate in _dup_. This function also returns zero on succes, or [`NNG_ENOMEM`]
+to the new duplicate in _dup_. This function also returns zero on success, or [`NNG_ENOMEM`]
if memory is exhausted.
## Message Size and Capacity
diff --git a/docs/ref/api/sock.md b/docs/ref/api/sock.md
index 4ebd8051..bc5c1380 100644
--- a/docs/ref/api/sock.md
+++ b/docs/ref/api/sock.md
@@ -227,7 +227,7 @@ These functions ({{i:`nng_recv`}}, {{i:`nng_recvmsg`}}, and {{i:`nng_socket_recv
messages over the socket _s_. The differences in their behaviors are as follows.
> [!NOTE]
-> The semantics of what receving a message means varies from protocol to
+> The semantics of what receiving a message means varies from protocol to
> protocol, so examination of the protocol documentation is encouraged.
> Additionally, some protocols may not support receiving at all or may require other pre-conditions first.
> (For example, [REQ][req] sockets cannot normally receive data until they have first sent a request,
diff --git a/docs/ref/api/stats.md b/docs/ref/api/stats.md
index 1720f605..b2a01d8e 100644
--- a/docs/ref/api/stats.md
+++ b/docs/ref/api/stats.md
@@ -81,7 +81,7 @@ const nng_stat *nng_stat_find_socket(const nng_stat *stat, nng_dialer socket);
```
Sometimes it is easiest to search for a specific statistic, matching by name,
-or possibly to find the tree of statistics associated iwth a specific [socket],
+or possibly to find the tree of statistics associated with a specific [socket],
[dialer], or [listener].
The `nng_stat_find` functions are provided for this purpose.
@@ -129,7 +129,7 @@ function can be used to obtain that value.
The units will be given by the value returned from [`nng_stat_unit`].
- {{i:`NNG_STAT_LEVEL`}}: <a name="NNG_STAT_LEVEL"></a>
- The statistic represnts a measured value which corresponds
+ The statistic represents a measured value which corresponds
to a specific value at a specific time. For example, this may represent the
number of messages currently queued for some operation, or the link speed
of a network interface. Most often the absolute value is more interesting
@@ -170,7 +170,7 @@ The {{i:`nng_stat_bool`}} function returns the Boolean value (either `true` or `
type [`NNG_STAT_BOOLEAN`]. If the statistics is not of this type, then it returns `false`.
The {{i:`nng_stat_string`}} function returns a pointer to a string value for the statistic _stat_,
-of type [`NNG_STAT_STRING`]. This string will remain valud until the snapshot that
+of type [`NNG_STAT_STRING`]. This string will remain valid until the snapshot that
_stat_ was collected with is deallocated with [`nng_stats_free`]. If the statistic
is not of type `NNG_STAT_STRING`, then `NULL` is returned.
diff --git a/docs/ref/api/synch.md b/docs/ref/api/synch.md
index 62e9b7c1..ea545cab 100644
--- a/docs/ref/api/synch.md
+++ b/docs/ref/api/synch.md
@@ -29,7 +29,7 @@ int nng_mutx_alloc(nng_mt **mtxp);
A mutex can be created by allocating one with {{i:`nng_mtx_lock`}}.
On success, a pointer to the mutex is returned through _mtxp_.
This function can fail due to insufficient memory or resources, in which
-case it will return [`NNG_ENOMEM`]. Otherwise it will succceed and return zero.
+case it will return [`NNG_ENOMEM`]. Otherwise it will succeed and return zero.
### Destroying a Mutex
@@ -132,7 +132,7 @@ The difference between these functions is that
one thread (which may be chosen randomly).
> [!TIP]
-> Use of `nng_cv_wake1` may be used to reduce the "{{i:thundering herd}}" syndrom of waking
+> Use of `nng_cv_wake1` may be used to reduce the "{{i:thundering herd}}" syndrome of waking
> all threads concurrently, but should only be used in circumstances where the application
> does not depend on _which_ thread will be woken. When in doubt, `nng_cv_wake` is safer.
diff --git a/docs/ref/api/thread.md b/docs/ref/api/thread.md
index 3286f71a..20b4eea1 100644
--- a/docs/ref/api/thread.md
+++ b/docs/ref/api/thread.md
@@ -32,7 +32,7 @@ applications.
typedef struct nng_thread nng_thread;
```
-The {{i:`nng_thread`}} structure represnts a thread, which is a single execution context.
+The {{i:`nng_thread`}} structure represents a thread, which is a single execution context.
A given thread will have its own stack, and CPU registers. However global state, as well
as values allocated on the heap, will be shared and accessible to all threads in the system
(See the [Synchronization][synchronization] chapter for functions to help with data sharing between different threads.)
diff --git a/docs/ref/api/time.md b/docs/ref/api/time.md
index 2855bca9..2b5ee9ba 100644
--- a/docs/ref/api/time.md
+++ b/docs/ref/api/time.md
@@ -12,7 +12,7 @@ typedef uint64_t nng_time;
The {{i:`nng_time`}} type is used to represent a clock offset from a common base time,
measured in milliseconds.
-The reference, or zero value, is some arbitrary point in time, most often sytem boot, but can
+The reference, or zero value, is some arbitrary point in time, most often system boot, but can
be process start time or any other convenient reference.
All threads within a process will use the same reference time, but be aware that different processes
diff --git a/docs/ref/migrate/nng1.md b/docs/ref/migrate/nng1.md
index 9e35465b..5b85c41d 100644
--- a/docs/ref/migrate/nng1.md
+++ b/docs/ref/migrate/nng1.md
@@ -161,7 +161,7 @@ used, and was error prone.
NNG 1.x had an undocumented ability to specify the local address to bind
to when dialing, by using the local address in front of the destination
address separated by a semicolon. This was provided for legacy libnanomsg
-compatilibility, and is no longer offered. The correct way to specify a
+compatibility, and is no longer offered. The correct way to specify a
local address is by setting `NNG_OPT_LOCADDR` on the dialer.
## IPC Option Type Changes
@@ -274,7 +274,7 @@ Note that the new functions provide a reference to a static string, and thus do
allocation, and the returned strings should not be freed. Also the IDs are provided as `uint16_t`,
matching the actual wire protocol values, instead of `int`.
-The `NNG_OPT_RAW` option has aso been replaced by a function, [`nng_socket_raw`].
+The `NNG_OPT_RAW` option has also been replaced by a function, [`nng_socket_raw`].
The `NNG_OPT_SENDFD` and `NNG_OPT_RECVFD` options have been replaced by
[`nng_socket_get_send_poll_fd`] and [`nng_socket_get_recv_poll_fd`] respectively.
@@ -284,7 +284,7 @@ Applications should keep track of this information separately.
## Subscriptions
-The `NNG_OPT_SUB_SUBSCRIBE` and `NNG_OPT_SUB_UNSUBCRIBE` options have been replaced by
+The `NNG_OPT_SUB_SUBSCRIBE` and `NNG_OPT_SUB_UNSUBSCRIBE` options have been replaced by
the following functions: [`nng_sub0_socket_subscribe`], [`nng_sub0_socket_unsubscribe`],
[`nng_sub0_ctx_subscribe`] and [`nng_sub0_ctx_unsubscribe`]. These functions, like the options
they replace, are only applicable to SUB sockets.
@@ -311,7 +311,7 @@ structure instead of a string.
## URL Structure Changes
The details of [`nng_url`] have changed significantly, and direct
-access of the structure is no longer permitted. Intead new
+access of the structure is no longer permitted. Instead new
accessors functions are provided:
- `u_scheme` is replaced by [`nng_url_scheme`].
diff --git a/include/nng/http.h b/include/nng/http.h
index 1ff541ac..08099cbe 100644
--- a/include/nng/http.h
+++ b/include/nng/http.h
@@ -214,7 +214,7 @@ typedef struct nng_http_handler nng_http_handler;
// nng_http_handler_alloc creates a server handler object, for the supplied
// absolute URI (path only) with the callback. By default the handler
-// is assumed to handle only GET requests (and implictly HEAD requests
+// is assumed to handle only GET requests (and implicitly HEAD requests
// as well.)
//
// Note that methods which modify a handler cannot be called while the handler
diff --git a/include/nng/nng.h b/include/nng/nng.h
index b3f9e461..a71a3f53 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -305,7 +305,7 @@ NNG_DECL int nng_socket_raw(nng_socket id, bool *rawp);
// Utility function for getting a printable form of the socket address
// for display in logs, etc. It is not intended to be parsed, and the
-// display format may change without notice. Generally you should alow
+// display format may change without notice. Generally you should allow
// at least NNG_MAXADDRSTRLEN if you want to avoid typical truncations.
// It is still possible for very long IPC paths to be truncated, but that
// is an edge case and applications that pass such long paths should
@@ -315,7 +315,7 @@ NNG_DECL const char *nng_str_sockaddr(
const nng_sockaddr *sa, char *buf, size_t bufsz);
// Obtain a port number (for NNG_AF_INET and NNG_AF_INET6this will be 16 bits
-// maximum, but other address familiies may have larger port numbers.) For
+// maximum, but other address families may have larger port numbers.) For
// address that don't have the concept of port numbers, zero will be returned.
NNG_DECL uint32_t nng_sockaddr_port(const nng_sockaddr *sa);
@@ -1317,7 +1317,7 @@ typedef struct {
// only the first call can contain a non-NULL params. If already
// initialized with non-NULL params, will return NNG_EALREADY.
// Applications should *not* call a matching nng_fini() in that case.
-NNG_DECL nng_err nng_init(const nng_init_params *parms);
+NNG_DECL nng_err nng_init(const nng_init_params *params);
// nng_fini is used to terminate the library, freeing certain global resources.
// Each call to nng_fini is paired to a call to nng_init. The last such
@@ -1365,7 +1365,7 @@ typedef enum nng_log_facility {
// as above. The message ID is chosen by the submitter - internal NNG
// messages will have MSGIDs starting with "NNG-". The MSGID should be
// not more than 8 characters, though this is not a hard requirement.
-// Loggers are required ot make a copy of the msgid and message if required,
+// Loggers are required to make a copy of the msgid and message if required,
// because the values will not be valid once the logger returns.
typedef void (*nng_logger)(nng_log_level level, nng_log_facility facility,
const char *msgid, const char *msg);
diff --git a/src/core/file.h b/src/core/file.h
index f89b1729..724b9d35 100644
--- a/src/core/file.h
+++ b/src/core/file.h
@@ -82,7 +82,7 @@ extern const char *nni_file_basename(const char *);
// false if an error occurs, or the path references something else.
extern bool nni_file_is_file(const char *);
-// nni_file_is_dir returns true if the path references a directroy. It returns
+// nni_file_is_dir returns true if the path references a directory. It returns
// false if an error occurs, or the path references something else.
extern bool nni_file_is_dir(const char *);
diff --git a/src/core/sockaddr.c b/src/core/sockaddr.c
index 15842b82..9dbb1c6c 100644
--- a/src/core/sockaddr.c
+++ b/src/core/sockaddr.c
@@ -87,7 +87,7 @@ nni_inet_ntop(const uint8_t addr[16], char buf[46])
idx += 2;
sep = false;
} else if (i < maxoff || i >= maxoff + maxcnt) {
- // this takes at most six bytes -- four hax digits a
+ // this takes at most six bytes -- four hex digits a
// colon, and a null
NNI_ASSERT(idx <= 40);
snprintf(buf + idx, 6, sep ? ":%x" : "%x",
diff --git a/src/core/socket.h b/src/core/socket.h
index d84f22c2..f18a4e15 100644
--- a/src/core/socket.h
+++ b/src/core/socket.h
@@ -89,7 +89,7 @@ extern void *nni_ctx_proto_data(nni_ctx *);
// by the context is also released.
extern void nni_ctx_rele(nni_ctx *);
-// nni_ctx_close is used to close the context. It also implictly releases
+// nni_ctx_close is used to close the context. It also implicitly releases
// the context.
extern void nni_ctx_close(nni_ctx *);
diff --git a/src/platform/windows/win_socketpair.c b/src/platform/windows/win_socketpair.c
index 57820c72..c788cd95 100644
--- a/src/platform/windows/win_socketpair.c
+++ b/src/platform/windows/win_socketpair.c
@@ -10,7 +10,7 @@
#include "core/nng_impl.h"
#ifdef NNG_HAVE_SOCKETPAIR_TODO
-// TODO: Windows lacks socketpair. We can emulate it with an explcit
+// TODO: Windows lacks socketpair. We can emulate it with an explicit
// implementation based on AF_UNIX.
#include <errno.h>
diff --git a/src/sp/protocol/reqrep0/req_test.c b/src/sp/protocol/reqrep0/req_test.c
index 17378c89..1da63ffc 100644
--- a/src/sp/protocol/reqrep0/req_test.c
+++ b/src/sp/protocol/reqrep0/req_test.c
@@ -429,7 +429,7 @@ test_req_cancel_abort_recv(void)
// Send req #1 (abc).
NUTS_SEND(req, "abc");
- // Wait for it to get ot the other side.
+ // Wait for it to get to the other side.
NUTS_SLEEP(100);
nng_aio_set_timeout(aio, 5 * SECOND);
diff --git a/src/sp/protocol/survey0/survey_test.c b/src/sp/protocol/survey0/survey_test.c
index bf6fbb08..ac6767ba 100644
--- a/src/sp/protocol/survey0/survey_test.c
+++ b/src/sp/protocol/survey0/survey_test.c
@@ -228,7 +228,7 @@ test_surv_cancel_abort_recv(void)
// Send survey #1 (abc).
NUTS_SEND(surv, "abc");
- // Wait for it to get ot the other side.
+ // Wait for it to get to the other side.
NUTS_SLEEP(100);
nng_aio_set_timeout(aio, 5 * SECOND);
diff --git a/src/sp/transport.h b/src/sp/transport.h
index 6aa2086b..72ce18d7 100644
--- a/src/sp/transport.h
+++ b/src/sp/transport.h
@@ -20,7 +20,7 @@
// protocol-independent fashion. The socket makes individual calls,
// which are expected to block if appropriate (except for destroy), or
// run asynchronously if an aio is provided. Endpoints are unable to
-// call back into the socket, to prevent recusive entry and deadlock.
+// call back into the socket, to prevent recursive entry and deadlock.
//
// For a given endpoint, the framework holds a lock so that each entry
// point is run exclusively of the others. (Transports must still guard
@@ -63,7 +63,7 @@ struct nni_sp_dialer_ops {
// This may be NULL if the dialer does not support TLS.
nng_err (*d_get_tls)(void *, nng_tls_config **);
- // d_set_tls is used to set the TLS configruation to use for the
+ // d_set_tls is used to set the TLS configuration to use for the
// dialer. This may be NULL if this dialer does not support TLS.
nng_err (*d_set_tls)(void *, nng_tls_config *);
@@ -117,7 +117,7 @@ struct nni_sp_listener_ops {
// This may be NULL if the listener does not support TLS.
nng_err (*l_get_tls)(void *, nng_tls_config **);
- // l_set_tls is used to set the TLS configruation to use for listening.
+ // l_set_tls is used to set the TLS configuration to use for listening.
// This may be NULL if this listener does not support TLS.
nng_err (*l_set_tls)(void *, nng_tls_config *);
diff --git a/src/sp/transport/udp/udp.c b/src/sp/transport/udp/udp.c
index e19a5684..41519aa3 100644
--- a/src/sp/transport/udp/udp.c
+++ b/src/sp/transport/udp/udp.c
@@ -726,7 +726,7 @@ udp_recv_creq(udp_ep *ep, udp_sp_creq *creq, nng_sockaddr *sa)
if ((p = udp_find_pipe(ep, creq->us_peer_id, creq->us_sender_id))) {
if ((p->peer_id == 0) || (p->peer != creq->us_type)) {
// we don't expect this -- a connection request from a
- // peer while we have an oustanding request of our own.
+ // peer while we have an outstanding request of our own.
// We *could* compare the sockaddrs to see if they
// match and if so then treat this as just a dueling
// connection. but for now we just discard it -- we'll
diff --git a/src/supplemental/http/http_server_test.c b/src/supplemental/http/http_server_test.c
index e091cd89..b55acd59 100644
--- a/src/supplemental/http/http_server_test.c
+++ b/src/supplemental/http/http_server_test.c
@@ -349,7 +349,7 @@ test_server_404(void)
}
static void
-test_server_no_authoritive_form(void)
+test_server_no_authoritative_form(void)
{
struct server_test st;
nng_http_handler *h;
@@ -1108,7 +1108,7 @@ NUTS_TESTS = {
{ "server canonify", test_server_canonify },
{ "server head", test_server_head },
{ "server 404", test_server_404 },
- { "server authoritiative form", test_server_no_authoritive_form },
+ { "server authoritiative form", test_server_no_authoritative_form },
{ "server bad canonify", test_server_bad_canonify },
{ "server bad version", test_server_bad_version },
{ "server missing host", test_server_missing_host },
diff --git a/src/testing/nuts.h b/src/testing/nuts.h
index d821b359..05e639b2 100644
--- a/src/testing/nuts.h
+++ b/src/testing/nuts.h
@@ -23,7 +23,7 @@ extern void nuts_logger(
nng_log_level, nng_log_facility, const char *, const char *);
// Call nng_fini during test finalization -- this avoids leak warnings.
-/// We add a 20 millisecond delay as a hack to allow for other subsytems to
+/// We add a 20 millisecond delay as a hack to allow for other subsystems to
// drain first. (Notably the HTTP framework can fail if we shut down too
// quickly. These bugs should be fixed and then the sleep can be removed.)
#ifndef TEST_FINI
diff --git a/src/tools/nngcat/nngcat_ambiguous_test.sh b/src/tools/nngcat/nngcat_ambiguous_test.sh
index 944d5aed..264d4704 100755
--- a/src/tools/nngcat/nngcat_ambiguous_test.sh
+++ b/src/tools/nngcat/nngcat_ambiguous_test.sh
@@ -17,7 +17,7 @@ CMD="${NNGCAT} --re --dial=tcp://127.0.0.1:27272"
echo -n "Verify ambiguous options fail: "
if ${CMD} >/dev/null 2>&1
then
- echo "Failed: ambigous accepted"
+ echo "Failed: ambiguous accepted"
exit 1
fi
x=$(${CMD} 2>&1)
diff --git a/src/tools/perf/pubdrop.c b/src/tools/perf/pubdrop.c
index 1788a3cf..83524609 100644
--- a/src/tools/perf/pubdrop.c
+++ b/src/tools/perf/pubdrop.c
@@ -108,7 +108,7 @@ parse_int(const char *arg, const char *what)
char *eptr;
val = strtol(arg, &eptr, 10);
- // Must be a postive number less than around a billion.
+ // Must be a positive number less than around a billion.
if ((val < 0) || (val > (1 << 30)) || (*eptr != 0) || (eptr == arg)) {
die("Invalid %s", what);
}
diff --git a/tests/convey.h b/tests/convey.h
index 299e0611..3a1740ca 100644
--- a/tests/convey.h
+++ b/tests/convey.h
@@ -54,7 +54,7 @@
* This was inspired by GoConvey -- github.com/smartystreets/goconvey - but
* there are differences of course -- C is not Go!
*
- * Pleaes note that we abuse the C preprocessor and setjmp fairly heavily,
+ * Please note that we abuse the C preprocessor and setjmp fairly heavily,
* and as a result of the magic we have to do, a lot of these guts must be
* exposed in this header file. HOWEVER, only symbols beginning with a
* capital letter are intended for consumers. All others are for internal
@@ -95,7 +95,7 @@ extern int conveyMainImpl(void);
/*
* conveyRun is a helper macro not to be called directly by user
* code. It has to be here exposed, in order for setjmp() to work.
- * and for the code block to be inlined. Becuase this inlines user
+ * and for the code block to be inlined. Because this inlines user
* code, we have to be *very* careful with symbol names.
*/
#define conveyRun(convey_name, convey_code, convey_resultp) \