Skip to content

Commit

Permalink
Fix typos in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
unspecd authored and gdamore committed Feb 14, 2020
1 parent cdda78d commit 0a315e4
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions demo/rest/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)) !=
Expand Down
2 changes: 1 addition & 1 deletion include/nng/compat/nanomsg/ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/nng/compat/nanomsg/nn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down
10 changes: 5 additions & 5 deletions include/nng/nng.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions include/nng/supplemental/util/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/core/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion src/supplemental/http/http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/transport/zerotier/zerotier.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down Expand Up @@ -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
};
Expand Down Expand Up @@ -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.)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0a315e4

Please sign in to comment.